
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title> 一审页面 </title>
  <link rel="stylesheet" type="text/css" href="/css/style.css" />

  <style type="text/css">
    *, body {
      margin: 0px;
      font-family: '微软雅黑';
    }
    ul,li{
      list-style: none;
    }
    .starts,.starts ul{float:left;}
    .starts{padding-left:16px;padding-top:7px;}
    .starts ul li{float:left;color:#ddd;padding-right:3px;font-size:28px;cursor: pointer;}
    .starts ul li.on{color:red;}
    .starts ul span{display:inline;float:left;padding-left:10px;}
  </style>
  <script src="~/js/jquery-1.10.2.min.js"></script>
  <script src="~/js/jquery.form.js"></script>
  <script src="~/js/generic.js"></script>
  <script src="/My97DatePicker/WdatePicker.js"></script>
  <script type="text/javascript">
    //保存选中的分数
    var score = "0";
    window.onload = function () {
      var s = document.getElementById("pingStar"),
              m = document.getElementById('dir'),
              n = s.getElementsByTagName("li"),
              input = document.getElementById('startP'); //保存所选值
      clearAll = function () {
        for (var i = 0; i < n.length; i++) {
          n[i].className = '';
        }
      }
      for (var i = 0; i < n.length; i++) {
        n[i].onclick = function () {
          var q = this.getAttribute("rel");
          //保存选中的分数
          score = q;
          clearAll();
          input.value = q;
          for (var i = 0; i < q; i++) {
            n[i].className = 'on';
          }
          m.innerHTML = this.getAttribute("title");
        }
        n[i].onmouseover = function () {
          var q = this.getAttribute("rel");
          clearAll();
          for (var i = 0; i < q; i++) {
            n[i].className = 'on';
          }
        }
        n[i].onmouseout = function () {
          clearAll();
          for (var i = 0; i < input.value; i++) {
            n[i].className = 'on';
          }
        }
      }
    }
  </script>

</head>

<body>

@Html.Partial("top")
<form id="filePost" method="post" enctype="multipart/form-data" onsubmit="return false;">
  <table class="maintable">
    <tr>
      @Html.Partial("menu")
      <td class="rightmaintd" valign="top">
        <div class="searchdiv">
          <a href="/yian/list?currPage=@ViewBag.CurrPage">&lt; 返回</a>     &nbsp; &nbsp; &nbsp; &nbsp;
          <div class="rightsearchdiv"><!-- name --></div>
        </div>
        <table class="leftrighttable" border="0" cellpadding="5">
          <tr>
            <td width="14%" class="tdname">医案编号 </td>
            <td width="20%"><input disabled="disabled" type="text" id="biaohao" class="yianinput" maxlength="50"></td>
            <td colspan="3">
              <table style="border: 1px solid #f2f2f2; margin:20px; width:350px;" width="350" border="1" cellpadding="5" id="tblCanKao"></table>

            </td>
            <td>
              <div class="fileUpload">
                <span id="spSmallImage3"> 上传图片 </span>
                <input type="file" id="smallfile3" name="smallfile3" class="upload" />
                <input type="hidden" id="hidSmallPic3" value="" />
              </div>
            </td>
          </tr>
          <tr>
            <td width="14%" class="tdname">患者姓名 </td>
            <td width="20%"><input type="text" id="xingming" class="yianinput" onblur="selectRecord()" maxlength="50"></td>
            <td width="13%" class="tdname">接诊医生 </td>
            <td width="20%"><input type="text" id="jiuzhenyisheng" onblur="selectRecord()" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">就诊 </td>
            <td width="20%">
              <select id="jiuzhenleixin" style="width:80px;">
                <option value="初诊">初诊</option>
                <option value="复诊">复诊</option>
              </select>
              <select id="keshi" style="float:right; margin-right:16px;">
                <option value="">请选择</option>
                <option value="内科">内科</option>
                <option value="外科">外科</option>
                <option value="儿科">儿科</option>
                <option value="妇科">妇科</option>
                <option value="皮肤科">皮肤科</option>
                <option value="五官科">五官科</option>
                <option value="急诊">急诊</option>
              </select>
            </td>
          </tr>
          <tr>
            <td width="13%" class="tdname">性别 </td>
            <td width="20%">
              <select id="xingbie">
                <option value="男" selected="selected">男</option>
                <option value="女">女</option>
              </select>
              &nbsp; &nbsp;&nbsp; 婚况
              <select id="hunkuang">
                <option value="">请选择</option>
                <option value="已婚">已婚</option>
                <option value="未婚">未婚</option>
              </select>
            </td>
            <td width="13%" class="tdname">药物过敏史 </td>
            <td width="20%"><input type="text" id="yaowoguominshi" class="yianinput" maxlength="50"></td>
            @*<td width="13%" class="tdname">就诊时间 </td>
            <td width="20%"><input type="text" id="jiuzhenshijian" onfocus="WdatePicker({readOnly:true})" class="yianinput"></td>*@
            <td width="20%" class="tdname">
              就诊时间
              <input type="text" id="year" class="yianinput" style="width:30px;" onchange="change()">
              年
            </td>
            <td width="20%">
              @*<input type="text" id="jiuzhenshijian" onfocus="WdatePicker({ readOnly: true, onpicking: dateClick })" class="yianinput">*@
              @*表示的是起始页到终止页*@

              <input type="text" id="month" class="yianinput" style="width:20px;" onchange="change()">
              月
              <input type="text" id="day" class="yianinput" style="width:20px;" onchange="change()">
              日
              其他
              <input type="text" id="otherTime" class="yianinput" style="width:35px;" onchange="change()">
            </td>
          </tr>
          <tr>
            <td width="13%" class="tdname">年龄 </td>
            <td width="20%"><input type="text" id="nianling" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">发病节气 </td>
            <td width="20%"><input type="text" id="fabingjieqi" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">朝代 </td>
            <td width="20%">
              <select id="chaodai" style="width:162px;height:28px;">
                <option value="">请选择</option>
                <option value="1979年后">1979年后</option>
                <option value="1949-1979年">1949-1979年</option>
                <option value="民国">民国</option>
                <option value="清">清</option>
                <option value="明">明</option>
                <option value="元">元</option>
                <option value="宋">宋</option>
                <option value="隋唐五代">隋唐五代</option>
                <option value="魏晋南北朝">魏晋南北朝</option>
                <option value="汉">汉</option>
                <option value="先秦">先秦</option>
                <option value="上古">上古</option>
              </select>
            </td>
          </tr>
          <tr>
            <td width="13%" class="tdname">书名 </td>
            <td width="20%"><input type="text" id="shuming" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">编者/主编 </td>
            <td width="20%"><input type="text" id="zuozhe" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">出版社 </td>
            <td width="20%"><input type="text" id="chubanshe" class="yianinput" maxlength="50"></td>
          </tr>
          <tr>
            <td width="13%" class="tdname">版次 </td>
            <td width="20%"><input type="text" id="banci" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">出版时间 </td>
            <td width="20%"><input type="text" id="chubanshijian" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname"> 起始页 </td>
            <td width="20%">
              <input type="text" id="yema" class="yianinput" style="width:45px;">
              &nbsp;&nbsp;终止页
              <input type="text" id="yemaEnd" class="yianinput" style="width:45px;">
            </td>
          </tr>
          <tr>
            <td width="13%" class="tdname">家族史 </td>
            <td width="20%"><input type="text" id="jzs" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">既往史 </td>
            <td colspan="3"><input type="text" id="jws" class="yianinput" maxlength="50"></td>
          </tr>
          <tr>
            <td width="15%" class="tdname">章节<span style="color:red">*</span></td>
            <td width="20%"><input type="text" id="zhangjie" class="yianinput" maxlength="50"></td>
            <td width="13%" class="tdname">条文序号<span style="color:red">*</span> </td>
            <td colspan="3"><input type="text" id="twxh" class="yianinput" maxlength="50"></td>
          </tr>
          <tr>
            <td width="20%" class="tdname" valign="top">原文<span style="color:red">*</span></td>
            <td colspan="5"><textarea id="yuanwen" rows="" cols="" class="textareainput" style="width: 600px;"></textarea></td>
          </tr>
          <tr>
            <td width="13%" class="tdname">
              就诊时间
            </td>
            <td width="20%">
              <input type="text" id="jiuzhenshijian" onfocus="WdatePicker({ readOnly: true })" class="yianinput">
            </td>
          </tr>
        </table>
        <table class="leftrighttable" border="0" cellpadding="5" id="divRecord" style="display:none">
          @*<tr>
          <td width="13%" class="tdname">章节</td>
          <td width="20%"><input type="text" id="zhangjie" class="yianinput" maxlength="50"></td>
          <td width="13%" class="tdname">条文序号 </td>
          <td colspan="3"><input type="text" id="twxh" class="yianinput" maxlength="50"></td>
        </tr>*@
        </table>
        <div class="fengexian"><!-- fengexian -------------------------------------------------------></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td colspan="4"><span class="yianbiaoti">问</span></td></tr>
          <tr>
            <td width="14%" class="tdname" valign="top">主诉</td>
            <td colspan="3">
              <input type="text" id="zhushu" class="yianinput" style="width: 300px;" maxlength="200">
            </td>
          </tr>
          <tr>
            <td width="13%" class="tdname" valign="top">现病史</td>
            <td colspan="3"><textarea id="xianbingshi" rows="" cols="" class="textareainput" style="width: 600px;"></textarea></td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian----------------------------------------------------- --></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td colspan="4"><span class="yianbiaoti">舌脉</span></td></tr>
          <tr>
            <td class="tdname" valign="top" align="right" width="135">
              <div>脉象</div>
              <div style="margin-top: 20px;">脉</div>
            </td>
            <td valign="top" colspan="3">
              <table border=0>
                <tr>
                  <td valign="top">
                    <select id="maizhen">
                      <option value="">请选择</option>
                      <option value="浮">浮脉</option>
                      <option value="沉">沉脉</option>
                      <option value="数">数脉</option>
                      <option value="迟">迟脉</option>
                      <option value="虚">虚脉</option>
                      <option value="实">实脉</option>
                      <option value="洪">洪脉</option>
                      <option value="微">微脉</option>
                      <option value="弦">弦脉</option>
                      <option value="缓">缓脉</option>
                      <option value="滑">滑脉</option>
                      <option value="涩">涩脉</option>
                      <option value="长">长脉</option>
                      <option value="短">短脉</option>
                      <option value="大">大脉</option>
                      <option value="小">小脉</option>
                      <option value="紧">紧脉</option>
                      <option value="弱">弱脉</option>
                      <option value="动">动脉</option>
                      <option value="伏">伏脉</option>
                      <option value="促">促脉</option>
                      <option value="结">结脉</option>
                      <option value="孔">孔脉</option>
                      <option value="革">革脉</option>
                      <option value="濡">濡脉</option>
                      <option value="牢">牢脉</option>
                      <option value="疾">疾脉</option>
                      <option value="细">细脉</option>
                      <option value="代">代脉</option>
                      <option value="散">散脉</option>
                    </select> &nbsp;
                    <input type="text" id="maizhen_qt" placeholder="其他脉象" />
                    <input type="button" onclick="addmz()" value="添加" class="tianjiabtn">
                  </td>
                </tr>
                <tr>

                  <td>
                    <div class="tianjiazhenzhuandiv" id="divmz">

                    </div>
                  </td>
                </tr>
              </table>
            </td>

          </tr>
          <tr>
            <td class="tdname" valign="top" align="right">舌诊</td>
            <td colspan="3">

              <table>
                <tr>
                  <td colspan="5">
                    <textarea id="shezhen" rows="" cols="" class="textareainput"></textarea>
                  </td>
                  <td colspan="1" align="right">
                    <img src="/images/zhongyao.png" style="width:50px;height: 50px;" id="img" alt="" class="zhongyaopic"> <br />
                    <div class="fileUpload2">
                      <span id="spSmallImage"> 上传 </span>
                      <input type="file" id="smallfile" name="smallfile" class="upload" />
                      <input type="hidden" id="hidSmallPic" value="" />
                    </div>
                  </td>
                </tr>
                <tr>
                  <td>舌色</td>
                  <td>
                    @*<select id="shese" onchange="sheselect();">*@
                    <select id="shese">
                      <option value="">请选择&nbsp;&nbsp;&nbsp;</option>
                      <option value="舌淡红">舌淡红</option>
                      <option value="舌红">舌红</option>
                      <option value="舌淡白">舌淡白</option>
                      <option value="舌质暗">舌质暗</option>
                      <option value="舌暗红">舌暗红</option>
                      <option value="舌暗淡">舌暗淡</option>
                    </select>
                  </td>
                  <td>苔体</td>
                  <td>
                    <select id="taiti">
                      <option value="">请选择</option>
                      <option value="苔薄">苔薄</option>
                      <option value="苔厚">苔厚</option>
                      <option value="苔腻">苔腻</option>
                    </select>
                  </td>
                  <td>苔质</td>
                  <td>
                    <select id="taizhi">
                      <option value="">请选择</option>
                      <option value="苔润">苔润</option>
                      <option value="苔燥">苔燥</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td>舌体</td>
                  <td>
                    <select id="sheti">
                      <option value="">请选择</option>
                      <option value="齿痕舌">齿痕舌</option>
                      <option value="裂纹舌">裂纹舌</option>
                      <option value="舌体瘀斑">舌体瘀斑</option>
                      <option value="舌体胖大">舌体胖大</option>
                    </select>
                  </td>
                  <td>苔色</td>
                  <td>
                    <select id="taise">
                      <option value="">请选择</option>
                      <option value="苔黄">苔黄</option>
                      <option value="苔白">苔白</option>
                      <option value="苔黑">苔黑</option>
                      <option value="苔灰">苔灰</option>
                      <option value="苔淡黄">苔淡黄</option>
                      <option value="苔微黄">苔微黄</option>
                      <option value="舌边尖红">舌边尖红</option>
                    </select>
                  </td>
                  <td></td>
                  <td></td>
                </tr>
              </table>
              <div class="">
              </div>
            </td>

          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td colspan="4"><span class="yianbiaoti">实验室检查</span></td></tr>
          <tr>
            <td width="135" class="tdname" valign="top"></td>
            <td colspan="3"><textarea id="sysjc" rows="" cols="" class="textareainput" style="width: 600px;"></textarea></td>
          </tr>
        </table>


        <div class="fengexian"><!-- fengexian --></div>


        <table width="950" class="leftrighttable" border="0" cellpadding="5" style="margin-left:20px;border:0px;">
          <tr>
            <td width="440" colspan="2"><span class="yianbiaoti">症候</span></td>
            <td width="510" colspan="2"><span class="yianbiaoti">&nbsp;</span></td>
          </tr>
          <tr>
            <td colspan="4">
              <table width="100%">
                <tr>
                  <td>寒热</td>
                  <td>
                    <select id="hanre">
                      <option value="">请选择</option>
                      <option value="不恶寒">不恶寒</option>
                      <option value="不发热">不发热</option>
                      <option value="潮热">潮热</option>
                      <option value="但热不寒">但热不寒</option>
                      <option value="低热">低热</option>
                      <option value="恶风">恶风</option>
                      <option value="恶风寒">恶风寒</option>
                      <option value="恶寒">恶寒</option>
                      <option value="恶寒发热">恶寒发热</option>
                      <option value="恶热">恶热</option>
                      <option value="发热">发热</option>
                      <option value="高热">高热</option>
                      <option value="寒栗">寒栗</option>
                      <option value="寒热往来">寒热往来</option>
                      <option value="寒战">寒战</option>
                      <option value="内热">内热</option>
                      <option value="怕风">怕风</option>
                      <option value="怕冷">怕冷</option>
                      <option value="日晡潮热">日晡潮热</option>
                      <option value="啬啬恶寒">啬啬恶寒</option>
                      <option value="身寒">身寒</option>
                      <option value="身热">身热</option>
                      <option value="身热不扬">身热不扬</option>
                      <option value="身热夜甚">身热夜甚</option>
                      <option value="身热肢寒">身热肢寒</option>
                      <option value="手足寒">手足寒</option>
                      <option value="外寒">外寒</option>
                      <option value="往来寒热">往来寒热</option>
                      <option value="微恶风">微恶风</option>
                      <option value="微恶风寒">微恶风寒</option>
                      <option value="微热">微热</option>
                      <option value="畏寒">畏寒</option>
                      <option value="畏寒发热">畏寒发热</option>
                      <option value="畏冷">畏冷</option>
                      <option value="五心烦热">五心烦热</option>
                      <option value="午后潮热">午后潮热</option>
                      <option value="淅淅恶风">淅淅恶风</option>
                      <option value="翕翕发热">翕翕发热</option>
                      <option value="夜热早凉">夜热早凉</option>
                      <option value="一阵恶寒，一阵发热">一阵恶寒，一阵发热</option>
                      <option value="一阵怕冷，一阵发热">一阵怕冷，一阵发热</option>
                      <option value="憎寒发热">憎寒发热</option>
                      <option value="战栗">战栗</option>
                      <option value="振寒">振寒</option>
                      <option value="蒸蒸发热">蒸蒸发热</option>
                      <option value="壮热">壮热</option>
                    </select>
                  </td>
                  <td>汗症</td>
                  <td>
                    <select id="hanzhen">
                      <option value="">请选择</option>
                      <option value="多汗">多汗</option>
                      <option value="少汗">少汗</option>
                      <option value="半身汗出">半身汗出</option>
                      <option value="大汗">大汗</option>
                      <option value="但头汗出">但头汗出</option>
                      <option value="盗汗">盗汗</option>
                      <option value="局部无汗">局部无汗</option>
                      <option value="局部有汗">局部有汗</option>
                      <option value="冷汗">冷汗</option>
                      <option value="冷汗淋漓">冷汗淋漓</option>
                      <option value="热甚汗多">热甚汗多</option>
                      <option value="无汗">无汗</option>
                      <option value="壮热无汗">壮热无汗</option>
                      <option value="自汗">自汗</option>
                      <option value="微汗">微汗</option>
                      <option value="漐漐汗出">漐漐汗出</option>
                      <option value="汗出濈濈然">汗出濈濈然</option>

                    </select>
                  </td>
                  <td>全身/形体</td>
                  <td>
                    <select id="xingti">
                      <option value="">请选择</option>
                      <option value="抽搐">抽搐</option>
                      <option value="拘挛">拘挛</option>
                      <option value="蠕动">蠕动</option>
                      <option value="颤动">颤动</option>
                      <option value="肥胖">肥胖</option>
                      <option value="消瘦">消瘦</option>
                      <option value="肌肉疼痛">肌肉疼痛</option>
                      <option value="肌肉发胀">肌肉发胀</option>
                      <option value="肌肉酸楚">肌肉酸楚</option>
                      <option value="肌肉萎缩">肌肉萎缩</option>
                      <option value="肉松皮缓">肉松皮缓</option>
                      <option value="乏力">乏力</option>
                      <option value="倦怠">倦怠</option>
                      <option value="倦怠乏力">倦怠乏力</option>
                      <option value="四肢不用">四肢不用</option>
                      <option value="肢体瘫痪">肢体瘫痪</option>
                      <option value="半身不遂">半身不遂</option>
                      <option value="蜷卧缩足">蜷卧缩足</option>
                      <option value="仰面伸足">仰面伸足</option>
                      <option value="坐而仰首">坐而仰首</option>
                      <option value="坐而俯首">坐而俯首</option>
                      <option value="麻木">麻木</option>
                      <option value="发麻">发麻</option>
                      <option value="疼痛">疼痛</option>
                      <option value="皮肤干燥">皮肤干燥</option>
                      <option value="皮肤黄染">皮肤黄染</option>
                      <option value="浮肿">浮肿</option>
                      <option value="易感冒">易感冒</option>
                      <option value="瘙痒">瘙痒</option>
                      <option value="项软">项软</option>
                      <option value="龟背">龟背</option>
                      <option value="项背拘急">项背拘急</option>
                      <option value="桶状胸">桶状胸</option>
                      <option value="鸡胸">鸡胸</option>
                      <option value="四肢疼痛">四肢疼痛</option>
                    </select>
                  </td>
                  <td>神志</td>
                  <td>
                    <select id="shenzhi">
                      <option value="">请选择</option>
                      <option value="少神">少神</option>
                      <option value="失神">失神</option>
                      <option value="假神">假神</option>
                      <option value="神乱">神乱</option>
                      <option value="神昏">神昏</option>
                      <option value="谵语">谵语</option>
                      <option value="有神">有神</option>
                      <option value="急躁易怒">急躁易怒</option>
                      <option value="多怒">多怒</option>
                      <option value="易怒">易怒</option>
                      <option value="喜怒">喜怒</option>
                      <option value="心烦">心烦</option>
                      <option value="烦躁">烦躁</option>
                      <option value="发狂">发狂</option>
                      <option value="喜静懒动">喜静懒动</option>
                      <option value="善恐">善恐</option>
                      <option value="易惊">易惊</option>
                      <option value="闷闷不乐">闷闷不乐</option>
                      <option value="多疑善虑">多疑善虑</option>
                      <option value="多愁善感">多愁善感</option>
                      <option value="抑郁">抑郁</option>
                      <option value="多疑">多疑</option>
                      <option value="悲观">悲观</option>
                      <option value="喜叹气">喜叹气</option>
                      <option value="喜太息">喜太息</option>
                      <option value="神情淡漠">神情淡漠</option>
                      <option value="健忘">健忘</option>
                      <option value="喜忘">喜忘</option>
                      <option value="呵欠">呵欠</option>
                      <option value="见水欲尿">见水欲尿</option>
                    </select>
                  </td>
                  <td>饮食</td>
                  <td>
                    <select id="yinshi">
                      <option value="">请选择</option>
                      <option value="食欲不振">食欲不振</option>
                      <option value="纳食佳">纳食佳</option>
                      <option value="纳佳">纳佳</option>
                      <option value="纳食尚可">纳食尚可</option>
                      <option value="纳可">纳可</option>
                      <option value="纳食一般">纳食一般</option>
                      <option value="食少">食少</option>
                      <option value="不欲食">不欲食</option>
                      <option value="纳差">纳差</option>
                      <option value="纳呆">纳呆</option>
                      <option value="纳少">纳少</option>
                      <option value="吞咽困难">吞咽困难</option>
                      <option value="呃逆">呃逆</option>
                      <option value="嗳气">嗳气</option>
                      <option value="泛酸">泛酸</option>
                      <option value="返酸">返酸</option>
                      <option value="反酸">反酸</option>
                      <option value="嘈杂">嘈杂</option>
                      <option value="烧心">烧心</option>
                      <option value="消谷善饥">消谷善饥</option>
                      <option value="多食">多食</option>
                      <option value="嗳气酸馊">嗳气酸馊</option>
                      <option value="嗳腐吞酸">嗳腐吞酸</option>
                      <option value="多食易饥">多食易饥</option>
                      <option value="消谷善饥">消谷善饥</option>
                      <option value="饥不欲食">饥不欲食</option>
                      <option value="偏食">偏食</option>
                      <option value="偏嗜异物">偏嗜异物</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td>饮水</td>
                  <td>
                    <select id="yinshui">
                      <option value="">请选择</option>
                      <option value="口干">口干</option>
                      <option value="口渴">口渴</option>
                      <option value="喜饮">喜饮</option>
                      <option value="多饮">多饮</option>
                      <option value="不喜饮">不喜饮</option>
                      <option value="喜冷饮">喜冷饮</option>
                      <option value="渴喜冷饮">渴喜冷饮</option>
                      <option value="喜热饮">喜热饮</option>
                      <option value="渴喜热饮">渴喜热饮</option>
                      <option value="不渴">不渴</option>
                      <option value="口渴多饮">口渴多饮</option>
                      <option value="口渴引饮">口渴引饮</option>
                      <option value="口大渴">口大渴</option>
                      <option value="口微渴">口微渴</option>
                      <option value="渴不多饮">渴不多饮</option>
                    </select>
                  </td>
                  <td>小便</td>
                  <td>
                    <select id="xiaobian">
                      <option value="">请选择</option>
                      <option value="小便淡黄">小便淡黄</option>
                      <option value="小便黄赤">小便黄赤</option>
                      <option value="尿长">尿长</option>
                      <option value="尿短">尿短</option>
                      <option value="尿少">尿少</option>
                      <option value="尿短黄">尿短黄</option>
                      <option value="小便不利">小便不利</option>
                      <option value="小便失禁">小便失禁</option>
                      <option value="小便自利">小便自利</option>
                      <option value="尿后余沥">尿后余沥</option>
                      <option value="尿不尽">尿不尽</option>
                      <option value="小便淋漓">小便淋漓</option>
                      <option value="尿急">尿急</option>
                      <option value="尿频">尿频</option>
                      <option value="尿痛">尿痛</option>
                      <option value="小便灼热">小便灼热</option>
                      <option value="尿清">尿清</option>
                      <option value="小便浑浊">小便浑浊</option>
                      <option value="尿血">尿血</option>
                      <option value="尿中砂石">尿中砂石</option>
                      <option value="尿浮脂膏">尿浮脂膏</option>
                      <option value="小便泡沫">小便泡沫</option>
                      <option value="小便臊臭">小便臊臭</option>
                      <option value="小便味甜">小便味甜</option>
                      <option value="小便清长">小便清长</option>
                      <option value="尿清长">尿清长</option>
                      <option value="多尿">多尿</option>
                      <option value="小便不通">小便不通</option>
                      <option value="夜尿多">夜尿多</option>
                      <option value="夜尿频多">夜尿频多</option>
                    </select>
                  </td>
                  <td>大便</td>
                  <td>
                    <select id="dabian">
                      <option value="">请选择</option>
                      <option value="大便尚可">大便尚可</option>
                      <option value="大便稀溏">大便稀溏</option>
                      <option value="便滽">便滽</option>
                      <option value="大便溏">大便溏</option>
                      <option value="大便偏稀">大便偏稀</option>
                      <option value="大便干结">大便干结</option>
                      <option value="便干">便干</option>
                      <option value="大便干">大便干</option>
                      <option value="大便偏干">大便偏干</option>
                      <option value="溏结不调">溏结不调</option>
                      <option value="大便时干时稀">大便时干时稀</option>
                      <option value="经常便秘">经常便秘</option>
                      <option value="经常腹泻">经常腹泻</option>
                      <option value="大便次数少">大便次数少</option>
                      <option value="大便次数多">大便次数多</option>
                      <option value="大便艰难">大便艰难</option>
                      <option value="大便不爽">大便不爽</option>
                      <option value="大便不畅">大便不畅</option>
                      <option value="大便失禁">大便失禁</option>
                      <option value="里急">里急</option>
                      <option value="后重">后重</option>
                      <option value="里急后重">里急后重</option>
                      <option value="大便夹冻">大便夹冻</option>
                      <option value="大便黏液">大便黏液</option>
                      <option value="便血">便血</option>
                      <option value="大便带血">大便带血</option>
                      <option value="黑便">黑便</option>
                      <option value="大便带虫">大便带虫</option>
                      <option value="大便味臭">大便味臭</option>
                      <option value="大便色绿">大便色绿</option>
                      <option value="大便色白">大便色白</option>
                      <option value="大便量多">大便量多</option>
                      <option value="大便量少">大便量少</option>
                      <option value="大便细">大便细</option>
                      <option value="矢气">矢气</option>
                      <option value="放屁">放屁</option>
                      <option value="矢气多">矢气多</option>
                      <option value="矢气少">矢气少</option>
                    </select>
                  </td>
                  <td>睡眠</td>
                  <td>
                    <select id="shuimian">
                      <option value="">请选择</option>
                      <option value="不寐">不寐</option>
                      <option value="嗜睡">嗜睡</option>
                      <option value="多梦">多梦</option>
                      <option value="恶梦">恶梦</option>
                      <option value="梦交">梦交</option>
                      <option value="睡眠尚可">睡眠尚可</option>
                      <option value="眠可">眠可</option>
                      <option value="梦游">梦游</option>
                      <option value="失眠">失眠</option>
                      <option value="多梦">多梦</option>
                      <option value="入睡困难">入睡困难</option>
                      <option value="睡后易醒">睡后易醒</option>
                      <option value="易惊醒">易惊醒</option>
                      <option value="遗精">遗精</option>
                    </select>
                  </td>
                  <td>语音</td>
                  <td>
                    <select id="yuyan">
                      <option value="">请选择</option>
                      <option value="语言謇涩">语言謇涩</option>
                      <option value="错语">错语</option>
                      <option value="失语">失语</option>
                      <option value="呓语">呓语</option>
                      <option value="声音高亢">声音高亢</option>
                      <option value="声音清脆">声音清脆</option>
                      <option value="声音嘶哑">声音嘶哑</option>
                      <option value="声音重浊">声音重浊</option>
                      <option value="语声低微">语声低微</option>
                      <option value="谵语">谵语</option>
                      <option value="郑声">郑声</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td>头面</td>
                  <td>
                    <select id="toumian">
                      <option value="">请选择</option>
                      <option value="头痛">头痛</option>
                      <option value="头蒙">头蒙</option>
                      <option value="头胀">头胀</option>
                      <option value="头重">头重</option>
                      <option value="头昏">头昏</option>
                      <option value="头摇">头摇</option>
                      <option value="头身酸重">头身酸重</option>
                      <option value="牙齿松动">牙齿松动</option>
                      <option value="牙痛">牙痛</option>
                      <option value="牙龈肿">牙龈肿</option>
                      <option value="牙龈出血">牙龈出血</option>
                      <option value="目赤">目赤</option>
                      <option value="目晴发黄">目晴发黄</option>
                      <option value="目眩">目眩</option>
                      <option value="目昏">目昏</option>
                      <option value="目干涩">目干涩</option>
                      <option value="目痛">目痛</option>
                      <option value="目痒">目痒</option>
                      <option value="雀目">雀目</option>
                      <option value="近视">近视</option>
                      <option value="暴盲">暴盲</option>
                      <option value="两目灼热">两目灼热</option>
                      <option value="羞明流泪">羞明流泪</option>
                      <option value="眵多">眵多</option>
                      <option value="眼窝凹陷">眼窝凹陷</option>
                      <option value="眼球突出">眼球突出</option>
                      <option value="目瞤">目瞤</option>
                      <option value="眼眶发黑">眼眶发黑</option>
                      <option value="眼睑下垂">眼睑下垂</option>
                      <option value="眼睑浮肿">眼睑浮肿</option>
                      <option value="口苦">口苦</option>
                      <option value="口甜">口甜</option>
                      <option value="口酸">口酸</option>
                      <option value="口中酸馊">口中酸馊</option>
                      <option value="口淡无味">口淡无味</option>
                      <option value="口眼歪斜">口眼歪斜</option>
                      <option value="口噤">口噤</option>
                      <option value="口臭">口臭</option>
                      <option value="多涎唾">多涎唾</option>
                      <option value="口角流涎">口角流涎</option>
                      <option value="唇麻">唇麻</option>
                      <option value="唇热">唇热</option>
                      <option value="唇干">唇干</option>
                      <option value="唇肿">唇肿</option>
                      <option value="鼻塞">鼻塞</option>
                      <option value="鼻痛">鼻痛</option>
                      <option value="鼻痒">鼻痒</option>
                      <option value="流涕">流涕</option>
                      <option value="鼻干">鼻干</option>
                      <option value="鼻出血">鼻出血</option>
                      <option value="喷嚏">喷嚏</option>
                      <option value="鼻鼾">鼻鼾</option>
                      <option value="不闻香臭">不闻香臭</option>
                      <option value="咽干">咽干</option>
                      <option value="咽痛">咽痛</option>
                      <option value="咽痒">咽痒</option>
                      <option value="喉中痰鸣">喉中痰鸣</option>
                      <option value="咽如物梗">咽如物梗</option>
                      <option value="咽红">咽红</option>
                      <option value="咽肿">咽肿</option>
                      <option value="咽喉溃烂">咽喉溃烂</option>
                      <option value="耳鸣">耳鸣</option>
                      <option value="耳胀">耳胀</option>
                      <option value="耳痛">耳痛</option>
                      <option value="耳痒">耳痒</option>
                      <option value="耳聋">耳聋</option>
                      <option value="重听">重听</option>
                      <option value="耳出血">耳出血</option>
                    </select>
                  </td>
                  <td>头部</td>
                  <td>
                    <select id="toubu">
                      <option value="">请选择</option>
                      <option value="头痛">头痛</option>
                      <option value="头蒙">头蒙</option>
                      <option value="头胀">头胀</option>
                      <option value="头重">头重</option>
                      <option value="头昏">头昏</option>
                      <option value="头摇">头摇</option>
                      <option value="头身酸重">头身酸重</option>
                      <option value="方头">方头</option>
                    </select>
                  </td>
                  <td>耳目</td>
                  <td>
                    <select id="ermu">
                      <option value="">请选择</option>
                      <option value="目赤">目赤</option>
                      <option value="目晴发黄">目晴发黄</option>
                      <option value="目眩">目眩</option>
                      <option value="目昏">目昏</option>
                      <option value="目干涩">目干涩</option>
                      <option value="目痛">目痛</option>
                      <option value="目痒">目痒</option>
                      <option value="雀目">雀目</option>
                      <option value="近视">近视</option>
                      <option value="暴盲">暴盲</option>
                      <option value="两目灼热">两目灼热</option>
                      <option value="羞明流泪">羞明流泪</option>
                      <option value="眵多">眵多</option>
                      <option value="眼窝凹陷">眼窝凹陷</option>
                      <option value="眼球突出">眼球突出</option>
                      <option value="目瞤">目瞤</option>
                      <option value="眼眶发黑">眼眶发黑</option>
                      <option value="眼睑下垂">眼睑下垂</option>
                      <option value="眼睑浮肿">眼睑浮肿</option>
                      <option value="耳鸣">耳鸣</option>
                      <option value="耳胀">耳胀</option>
                      <option value="耳痛">耳痛</option>
                      <option value="耳痒">耳痒</option>
                      <option value="耳聋">耳聋</option>
                      <option value="重听">重听</option>
                      <option value="耳出血">耳出血</option>
                    </select>
                  </td>
                  <td>口鼻咽</td>
                  <td>
                    <select id="koubiyan">
                      <option value="">请选择</option>
                      <option value="牙齿松动">牙齿松动</option>
                      <option value="牙痛">牙痛</option>
                      <option value="牙龈肿">牙龈肿</option>
                      <option value="牙龈出血">牙龈出血</option>
                      <option value="口苦">口苦</option>
                      <option value="口甜">口甜</option>
                      <option value="口酸">口酸</option>
                      <option value="口中酸馊">口中酸馊</option>
                      <option value="口淡无味">口淡无味</option>
                      <option value="口眼歪斜">口眼歪斜</option>
                      <option value="口噤">口噤</option>
                      <option value="口臭">口臭</option>
                      <option value="多涎唾">多涎唾</option>
                      <option value="口角流涎">口角流涎</option>
                      <option value="唇麻">唇麻</option>
                      <option value="唇热">唇热</option>
                      <option value="唇干">唇干</option>
                      <option value="唇肿">唇肿</option>
                      <option value="鼻塞">鼻塞</option>
                      <option value="鼻痛">鼻痛</option>
                      <option value="鼻痒">鼻痒</option>
                      <option value="流涕">流涕</option>
                      <option value="鼻干">鼻干</option>
                      <option value="鼻出血">鼻出血</option>
                      <option value="喷嚏">喷嚏</option>
                      <option value="鼻鼾">鼻鼾</option>
                      <option value="不闻香臭">不闻香臭</option>
                      <option value="咽干">咽干</option>
                      <option value="咽痛">咽痛</option>
                      <option value="咽痒">咽痒</option>
                      <option value="喉中痰鸣">喉中痰鸣</option>
                      <option value="咽如物梗">咽如物梗</option>
                      <option value="咽红">咽红</option>
                      <option value="咽肿">咽肿</option>
                      <option value="咽喉溃烂">咽喉溃烂</option>
                    </select>
                  </td>
                  <td>颈项</td>
                  <td>
                    <select id="jingxiang">
                      <option value="">请选择</option>
                      <option value="颈脉动甚">颈脉动甚</option>
                      <option value="瘰疬">瘰疬</option>
                      <option value="项软">项软</option>
                      <option value="颈项拘急">颈项拘急</option>
                      <option value="项背强">项背强</option>
                      <option value="头项强痛">头项强痛</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td>胸腹</td>
                  <td>
                    <select id="xiongfu">
                      <option value="">请选择</option>
                      <option value="恶心">恶心</option>
                      <option value="呕吐">呕吐</option>
                      <option value="呕">呕</option>
                      <option value="吐">吐</option>
                      <option value="干呕">干呕</option>
                      <option value="哕">哕</option>
                      <option value="咳嗽">咳嗽</option>
                      <option value="干咳">干咳</option>
                      <option value="呛咳">呛咳</option>
                      <option value="顿咳">顿咳</option>
                      <option value="呼吸急促">呼吸急促</option>
                      <option value="呼吸困难">呼吸困难</option>
                      <option value="呼吸气粗">呼吸气粗</option>
                      <option value="呼吸微弱">呼吸微弱</option>
                      <option value="气短">气短</option>
                      <option value="上气">上气</option>
                      <option value="少气/气微">少气/气微</option>
                      <option value="夺气">夺气</option>
                      <option value="胁痛">胁痛</option>
                      <option value="胁胀">胁胀</option>
                      <option value="胁部拘急">胁部拘急</option>
                      <option value="胁部灼热">胁部灼热</option>
                      <option value="腹痛">腹痛</option>
                      <option value="腹胀">腹胀</option>
                      <option value="单腹胀大">单腹胀大</option>
                      <option value="肠鸣">肠鸣</option>
                      <option value="腹坠">腹坠</option>
                      <option value="腹部板硬">腹部板硬</option>
                      <option value="腹中灼热">腹中灼热</option>
                      <option value="腹中发凉">腹中发凉</option>
                      <option value="腹部悸动">腹部悸动</option>
                      <option value="胸痛">胸痛</option>
                      <option value="胸闷">胸闷</option>
                      <option value="胸中灼热">胸中灼热</option>
                      <option value="胸中发凉">胸中发凉</option>
                      <option value="心悸">心悸</option>
                      <option value="心烦">心烦</option>
                      <option value="心悬">心悬</option>
                      <option value="乳房痛">乳房痛</option>
                      <option value="乳房胀">乳房胀</option>
                      <option value="乳头出血">乳头出血</option>
                    </select>
                  </td>
                  <td>腰背</td>
                  <td>
                    <select id="yaobei">
                      <option value="">请选择</option>
                      <option value="腰痛">腰痛</option>
                      <option value="背痛">背痛</option>
                      <option value="腰酸">腰酸</option>
                      <option value="腰胀">腰胀</option>
                      <option value="腰重">腰重</option>
                      <option value="腰冷">腰冷</option>
                      <option value="腰热">腰热</option>
                      <option value="龟背">龟背</option>
                      <option value="项背拘急">项背拘急</option>
                    </select>
                  </td>
                  <td>四肢</td>
                  <td>
                    <select id="sizhi">
                      <option value="">请选择</option>
                      <option value="足跟痛">足跟痛</option>
                      <option value="甲床淡白">甲床淡白</option>
                      <option value="甲床青紫">甲床青紫</option>
                      <option value="指甲干枯">指甲干枯</option>
                      <option value="指甲反凹">指甲反凹</option>
                      <option value="指甲薄软">指甲薄软</option>
                      <option value="小腿青筋">小腿青筋</option>
                      <option value="四肢不用">四肢不用</option>
                      <option value="痿废不用">痿废不用</option>
                      <option value="肢体瘫痪">肢体瘫痪</option>
                      <option value="半身不遂">半身不遂</option>
                      <option value="偏瘫">偏瘫</option>
                      <option value="下肢水肿">下肢水肿</option>
                      <option value="下肢微肿">下肢微肿</option>
                      <option value="下肢浮肿">下肢浮肿</option>
                      <option value="四肢疼痛">四肢疼痛</option>
                      <option value="半身汗出">半身汗出</option>
                      <option value="四肢发凉">四肢发凉</option>
                      <option value="肢冷">肢冷</option>
                      <option value="下肢冷">下肢冷</option>
                      <option value="下肢发凉">下肢发凉</option>
                    </select>
                  </td>
                  <td>月经</td>
                  <td>
                    <select id="yuejing">
                      <option value="">请选择</option>
                      <option value="月经量多">月经量多</option>
                      <option value="月经量少">月经量少</option>
                      <option value="月经时多时少">月经时多时少</option>
                      <option value="月经先期">月经先期</option>
                      <option value="月经后期">月经后期</option>
                      <option value="月经先后无定期">月经先后无定期</option>
                      <option value="闭经">闭经</option>
                      <option value="经期缩短">经期缩短</option>
                      <option value="经期延长">经期延长</option>
                      <option value="月经紫黯">月经紫黯</option>
                      <option value="月经淡红">月经淡红</option>
                      <option value="月经鲜红">月经鲜红</option>
                      <option value="月经血块">月经血块</option>
                      <option value="痛经">痛经</option>
                      <option value="崩漏">崩漏</option>
                      <option value="停经">停经</option>
                      <option value="经行不畅">经行不畅</option>
                      <option value="月经质稀">月经质稀</option>
                      <option value="月经质稠">月经质稠</option>
                      <option value="经断复来">经断复来</option>
                      <option value="经来骤止">经来骤止</option>
                      <option value="月经腥臭">月经腥臭</option>
                      <option value="经间期出血">经间期出血</option>
                    </select>
                  </td>
                  <td>白带</td>
                  <td>
                    <select id="baidai">
                      <option value="">请选择</option>
                      <option value="带下量多">带下量多</option>
                      <option value="带下量少">带下量少</option>
                      <option value="带下色白">带下色白</option>
                      <option value="带下色黄">带下色黄</option>
                      <option value="带下色赤">带下色赤</option>
                      <option value="带下色青">带下色青</option>
                      <option value="带下色黑">带下色黑</option>
                      <option value="带见五色">带见五色</option>
                      <option value="带下味臭">带下味臭</option>
                      <option value="带下稀">带下稀</option>
                      <option value="带下稠">带下稠</option>
                      <option value="带下清">带下清</option>
                      <option value="带下浊">带下浊</option>
                      <option value="阴痒">阴痒</option>
                    </select>
                  </td>
                </tr>
              </table>
            </td>
          </tr>

          <tr>
            <td valign="top" align="right">
              输入症候
            </td>
            <td colspan="3">
              <select id="buwei" onchange="buwei_change()"></select>
              <select id="jianchaxiang" onchange="jianchaxiang_change()"></select>
              <select id="zhenghou"></select>
            </td>
          </tr>
          <tr>
            <td valign="top" align="right">
              其他症候
            </td>
            <td colspan="3">
              <input type="text" value="" placehold="其他症候" id="zhenghou_qt" />
              <input type="button" value="添 加" class="tianjiabtn" onclick="addzz();">
            </td>
          </tr>
          <tr>
            <td width="135" valign="top" align="right"></td>
            <td width="405" colspan="3">
              <div class="tianjiazhenzhuandiv" id="divZhenzhuang">
              </div>
            </td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>

        <table width="950" class="leftrighttable" border="0" cellpadding="5" style="margin-left:20px;border:0px;">
          <tr>
            <td width="440" colspan="2"><span class="yianbiaoti">中医诊断</span></td>
            <td width="510" colspan="2"><span class="yianbiaoti">&nbsp;</span></td>
          </tr>
          <tr>

            <td width="135" valign="top" align="right">
              <div style="margin-top:12px;">输入病名</div>
              <div style="margin-top:95px;">输入病机</div>
            </td>
            <td width="305">
              <input type="text" id="zyzd" class="textinput_ai"> <input type="button" value="添 加" class="tianjiabtn" onclick="addzy();">
              <div id='selectZZ' style="width: 160px;display: none; border: 1px solid #ddd; position: relative;  z-index: 11; background: #fff; display:;">

              </div>
              <div class="tianjiazhenzhuandiv" id="divzy">
              </div>
              <div style="margin-top: 5px;">
                <input type="text" class="textinput" value="" id="bingji" />
              </div>
            </td>
            <td width="85" valign="top"><div style="margin-top:12px;">&nbsp;</div></td>
            <td width="425">
              &nbsp;
            </td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>


        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td><span class="yianbiaoti">西医检查数据</span> &nbsp; &nbsp; &nbsp;<span onclick="showxiyibiao()" style="color:#009933; cursor:pointer;">（查看详情）</span></td></tr>
        </table>
        <table id="xiyijianchabiao" class="leftrighttable" width="950" border="1" cellpadding="5" style="display:none;">
          <tr>
            <td width="130" align="right">检查项目</td>
            <td width="200">
              <select id="jianchaxiangmu" style="width:162px;border:1px solid #ddd;">
                <option value="请选择">请选择</option>
                <option value="血常规">血常规</option>
                <option value="尿常规">尿常规</option>
                <option value="肝功能">肝功能</option>
                <option value="心电图">心电图</option>
                <option value="B超">B超</option>
                <option value="X片">X片</option>
              </select>
            </td>
            <td width="70" rowspan="4">
              <input type="button" value="增加项&gt;" class="tianjiabtn" onclick="addjc();">
            </td>
            <td width="550" rowspan="4" valign="top">
              <table class="xiyijianchabiao" id="divJiancha">
                <tr bgcolor="#f2f2f2">
                  <td width="20%">检查项目</td>
                  <td width="30%">检查时间</td>
                  <td width="25%">结果摘要</td>
                  <td width="15%">附件</td>
                  <td width="10%"></td>
                </tr>
              </table>
            </td>
          </tr>
          <tr><td align="right">检查时间</td><td><input type="text" id="shijian" onfocus="WdatePicker({readOnly:true})" class="yianinput"></td></tr>
          <tr><td align="right">结果摘要</td><td><input type="text" id="jieguo" class="yianinput"></td></tr>
          <tr>
            <td align="right"></td>
            <td>
              <div class="fileUpload">
                <span id="spJianchaImage">上传检查图片</span>
                <input type="file" id="jianchafile" name="jianchafile" class="upload" />
                <input type="hidden" id="hidJianchaPic" value="" />
              </div>
            </td>
          </tr>
        </table>

        <script type="text/javascript">
          var _jb_xb_flag = 1;
          function showxiyibiao() {
            $("#xiyijianchabiao").toggle();
          }

          function showjianfan(num) {
            _jb_xb_flag = num;
            if (num == 1) {
              $("#jianban").show();
              $("#fangban").hide();
            } else {
              $("#jianban").hide();
              $("#fangban").show();
            }

          }
        </script>

        <div class="fengexian"><!-- fengexian --></div>

        <table width="950" class="leftrighttable" border="0" cellpadding="5" style="margin-left:20px;border:0px;">
          <tr>
            <td width="440" colspan="2"><span class="yianbiaoti">西医诊断</span></td>
            <td width="510" colspan="2"><span class="yianbiaoti">&nbsp;</span></td>
          </tr>
          <tr>

            <td width="135" valign="top" align="right">
              <div style="margin-top:12px;">输入病名</div>
            </td>
            <td width="305">
              <input type="text" id="xyzd" class="textinput_ai"> <input type="button" value="添 加" class="tianjiabtn" onclick="addxy();">
              <div id='selectZZ' style="width: 160px;display: none; border: 1px solid #ddd; position: relative;  z-index: 11; background: #fff; display:;">

              </div>
              <div class="tianjiazhenzhuandiv" id="divxy">
              </div>
            </td>
            <td width="85" valign="top">&nbsp;</td>
            <td width="425">
              &nbsp;

            </td>
          </tr>
        </table>
        <div class="fengexian"><!-- fengexian --></div>

        <table width="950" class="leftrighttable" border="0" cellpadding="5" style="margin-left:20px;border:0px;">
          <tr>
            <td width="440" colspan="2"><span class="yianbiaoti">治则治法</span></td>
            <td width="510" colspan="2"><span class="yianbiaoti">&nbsp;</span></td>
          </tr>
          <tr>


            <td width="135" valign="top" align="right"><div style="margin-top:12px;"></div> </td>
            <td width="305">
              <table>
                <tr>
                  <td width="40">治则 </td>
                  <td>
                    <select id="zhize" style="width:265px;border:1px solid #ddd;">
                      <option value="">请选择</option>
                      <option value="早治防变">早治防变</option>
                      <option value="治病求本">治病求本</option>
                      <option value="扶正祛邪">扶正祛邪</option>
                      <option value="急则治标">急则治标</option>
                      <option value="缓则治本">缓则治本</option>
                      <option value="正治">正治</option>
                      <option value="反治">反治</option>
                      <option value="调整阴阳">调整阴阳</option>
                      <option value="调理气血">调理气血</option>
                      <option value="调理脏腑">调理脏腑</option>
                      <option value="三因制宜">三因制宜</option>
                    </select>
                  </td>

                </tr>
                <tr>
                  <td>治法 </td>
                  <td>
                    <select id="zhifa" style="width:265px;border:1px solid #ddd;">
                      <option value="">请选择</option>
                      <option value="汗">汗</option>
                      <option value="吐">吐</option>
                      <option value="下">下</option>
                      <option value="和">和</option>
                      <option value="温">温</option>
                      <option value="清">清</option>
                      <option value="补">补</option>
                      <option value="消">消</option>
                      <option value="涩">涩</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td valign="top">说明 </td>
                  <td><textarea id="shuoming" rows="" cols="" class="textareainput"></textarea></td>
                </tr>
              </table>
            </td>
            <td width="85" valign="top">&nbsp;</td>
            <td width="425">&nbsp;</td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td><span class="yianbiaoti">医案处方</span> &nbsp; &nbsp; &nbsp;<a class="" onclick="showjianfan(1)">简 版</a> &nbsp; &nbsp; &nbsp;<a class="" onclick="showjianfan(2)">详细版</a></td></tr>
        </table>
        <table id="jianban" class="leftrighttable" width="950" border="1" cellpadding="5">
          <tr>
            <td width="130" align="right">处方名称</td>
            <td colspan="5"><input type="text" id="chufangmingcheng_jb" class="textinput"> </td>
          </tr>
          <tr>
            <td width="130" align="right">中药名</td>
            <td>
              <input type="text" id="yaoming_jd" onkeyup="selectym();" class="yianinput">
              <div id='selectYM' style="width: 160px;display: none; border: 1px solid #ddd; position: relative;  z-index: 11; background: #fff; ">
              </div>
            </td>

            <td colspan="2">
              <table>
                <tr>

                  <td class="tdname">药量 </td>
                  <td><input type="text" id="yaoliang_jd" class="yianinput"></td>
                </tr>
              </table>
            </td>
            <td align="right">备注</td>
            <td><input type="text" id="beizhu_jd" class="yianinput">&nbsp;&nbsp;<input type="submit" value="增加药&gt;" onclick="addcf()" class="tianjiabtn"></td>
          </tr>
          <tr>
            <td width="130" align="right">总药味: <span id="spnumber_jd"></span></td>
            <td colspan="5">
              <div class="chufangdiv" id="chufangdivjiandan">
              </div>
            </td>
          </tr>
          <tr>
            <td width="130" align="right">剂数</td>
            <td colspan="2">
              <input type="text" id="jishu_jb" class="yianinput">
            </td>
            <td width="130" align="right">煎服法</td>
            <td colspan="2">
              <input type="text" id="jianfufa_jb" class="yianinput">
            </td>
          </tr>
        </table>


        <!-- 详版 ------------------------------------------------------------------ -->

        <table id="fangban" style="display: none;" class="leftrighttable" border="1" cellpadding="5">
          <tr>
            <td width="130" class="tdname">处方名称 </td>
            <td width="180"><input type="text" id="chufangmingcheng" class="yianinput"></td>
            <td width="130" class="tdname">类型 </td>
            <td width="180">
              <select id="leixing" style="width:162px;">
                <option value="自拟">自拟</option>
                <option value="成方化裁">成方化裁</option>
              </select>
            </td>
            <td width="120" class="tdname">剂型 </td>
            <td width="210">
              <select id="jixing" style="width:162px;">
                <option value="汤">汤</option>
                <option value="丸">丸</option>
                <option value="散">散</option>
                <option value="膏">膏</option>
                <option value="丹">丹</option>
                <option value="茶">茶</option>
                <option value="露">露</option>
                <option value="锭">锭</option>
                <option value="酒">酒</option>
                <option value="条">条</option>
                <option value="线">线</option>
                <option value="洗">洗</option>
                <option value="搽">搽</option>
                <option value="栓">栓</option>
              </select>
            </td>
          </tr>
          <tr>
            <td class="tdname">煎服法 </td>
            <td>
              <select id="jianfufa" style="width:162px;">
                <option value="">请选择</option>
                <option value="久煎">久煎</option>
                <option value="轻煎">轻煎</option>
                <option value="去渣再煎">去渣再煎</option>
                <option value="泡服">泡服</option>
              </select>
            </td>
            <td class="tdname">服药时间 </td>
            <td>
              <select id="fuyaoshijian" style="width:162px;">
                <option value="">请选择</option>
                <option value="饭前">饭前</option>
                <option value="饭后">饭后</option>
                <option value="早晨">早晨</option>
                <option value="中午">中午</option>
                <option value="晚上">晚上</option>
              </select>
            </td>
            <td class="tdname">剂数 </td>
            <td><input type="text" id="jishu" class="yianinput"></td>
          </tr>
          <tr>
            <td class="tdname">使用方法 </td>
            <td>
              <select id="shiyongfangfa" style="width:162px;">
                <option value="">请选择</option>
                <option value="内用">内用</option>
                <option value="外用">外用</option>
                <option value="熏蒸">熏蒸</option>
                <option value="坐浴">坐浴</option>
              </select>
            </td>
            <td class="tdname">次数和药量 </td>
            <td>
              <input type="text" id="cishuyaoliang" class="yianinput">
            </td>
            <td class="tdname">  </td>
            <td> </td>
          </tr>
          <tr>
            <td class="tdname">服后反馈 </td>
            <td>
              <select id="fuhoufankui" style="width:162px;">
                <option value="">请选择</option>
                <option value="痊愈">痊愈</option>
                <option value="好转">好转</option>
                <option value="不详">不详</option>
              </select>
            </td>
            <td class="tdname">其他事项 </td>
            <td>
              <input type="text" id="qitashixiang" class="yianinput">
            </td>
            <td class="tdname">  </td>
            <td> </td>
          </tr>

          <tr>
            <td colspan="6">

              <hr style="border:1px solid #eeeeee; width:95%; float:right;">
              <table width="900" border="0" cellpadding="5">

                <tr>
                  <td width="110" align="right"> 中药名</td>
                  <td>
                    <input type="text" id="zhongyaoming" onkeyup="selectzym();" class="yianinput">
                    <div id='selectZYM' style="width: 160px;display: none; border: 1px solid #ddd; position: relative; z-index: 11; background: #fff; ">

                    </div>
                  </td>

                  <td width="80" rowspan="6"><input type="button" value="增加药&gt;" class="tianjiabtn" onclick="addcf()"></td>
                  <td width="530" rowspan="6" valign="top">
                    &nbsp; 总药味: <span id="spnumber"></span> <br />
                    <table width="100%">
                      <tr align="center">
                        <td width="25%">中药名</td>
                        <td width="15%">药量</td>
                        <td width="20%">炮制</td>
                        <td width="15%">产地</td>
                        <td width="15%">备注</td>
                        <td width="10%">&nbsp; &nbsp;</td>
                      </tr>
                    </table>

                    <div class="chufangdivxiangxi">
                      <table width="100%" id="tblChufang"></table>
                    </div>
                  </td>
                </tr>

                <tr>
                  <td align="right">药量</td>
                  <td><input type="text" id="yaoliang" class="yianinput"></td>
                </tr>
                <tr>
                  <td align="right"></td>
                  <td>
                    <input type="radio" id="jinzhi" name="jinguzhi" value="今制" checked="checked">今制  <input type="radio" id="guzhi" name="jinguzhi" value="古制">古制
                    <select id="daiding">
                      <option value="待定">待定</option>
                      <option value="君">君</option>
                      <option value="臣">臣</option>
                      <option value="配">配</option>
                      <option value="佐">佐</option>
                      <option value="伍">伍</option>
                    </select>
                  </td>
                </tr>
                <tr>
                  <td align="right">炮制</td>
                  <td><input type="text" id="paozhi" class="yianinput"></td>
                </tr>
                <tr>
                  <td align="right">产地</td>
                  <td><input type="text" id="chandi" class="yianinput"></td>
                </tr>
                <tr>
                  <td align="right">备注</td>
                  <td>
                    <select id="beizhu" style="width:162px;">
                      <option value="">请选择</option>
                      <option value="先煎">先煎</option>
                      <option value="后下">后下</option>
                      <option value="另煎">另煎</option>
                      <option value="包煎">包煎</option>
                    </select>
                  </td>
                </tr>
              </table>

            </td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td colspan="4"><span class="yianbiaoti">其他医嘱</span></td></tr>
          <tr>
            <td width="135" class="tdname" valign="top"></td>
            <td colspan="3"><textarea id="qtyz" rows="" cols="" class="textareainput" style="width: 600px;"></textarea></td>
          </tr>
        </table>


        <div class="fengexian"><!-- fengexian --></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td colspan="4"><span class="yianbiaoti">药后反馈</span></td></tr>
          <tr>
            <td width="135" class="tdname" valign="top"></td>
            <td colspan="3"><textarea id="bafx" rows="" cols="" class="textareainput" style="width: 600px;"></textarea></td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>

        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td colspan="4"><span class="yianbiaoti">病案评论及要点</span></td></tr>
          <tr>
            <td width="135" class="tdname" valign="top"></td>
            <td colspan="3"><textarea id="xxxd" rows="" cols="" class="textareainput" style="width: 600px;"></textarea></td>
          </tr>
        </table>
        <div class="fengexian"><!-- fengexian --></div>
        <table class="leftrighttable" border="0" cellpadding="5">
          <tr><td><span id="pingfen" class="yianbiaoti"></span></td>
            <td>
              <div class="starts">
                <ul id="pingStar">
                  <li rel="1" title="1分">★</li>
                  <li rel="2" title="2分">★</li>
                  <li rel="3" title="3分">★</li>
                  <li rel="4" title="4分">★</li>
                  <li rel="5" title="5分">★</li>
                  <span id="dir"></span>
                </ul>
                <input type="hidden" value="" id="startP">
              </div>
            </td>
          </tr>
        </table>

        <div class="fengexian"><!-- fengexian --></div>
        <div class="shenhediv">
          <input type="button" value="保 &nbsp; &nbsp; 存" class="baocunbtn" onclick="saveInfo();">
          @*<input type="button" value="保存继续输入" class="baocunbtn" onclick="saveInfo_new();">*@
          <input type="button" value="一审通过" style="display: none;" id="btnValidate" class="shenhebtn" onclick="validate();"> &nbsp;&nbsp;
          <span id="lrxx"></span>
        </div>
      </td>
    </tr>
  </table>
</form>
@Html.Partial("bottom")

</body>
</html>
<script type="text/javascript">
  //var zhongxiyi = "古籍";
  var usertype = "@type";
  var _app_guid = '@ViewBag.Guid';
  var _app_edit = '@ViewBag.EditState';
  var zhengzhuang = [];
  var jiancha = [];
  var chufang = [];
  var maizhen = [];
  var zhongyi = [];
  var xiyi = [];
  var cankao = [];
  //添加古籍
  var guji = [];

  var submit = true;
  function buwei_change() {
    util.getJSON("/FirstCheck/GetJianchaxiang", { "buwei": $("#buwei").val() }, function (json) {
      $("#jianchaxiang").empty();
      for (var i = 0; i < json.list.length; i++) {
        $("#jianchaxiang").append("<option value='" + json.list[i].name + "'>" + json.list[i].name + "</option>");
      }
      jianchaxiang_change();
    });
  }

  function jianchaxiang_change() {
    util.getJSON("/FirstCheck/GetZhenhou", { "buwei": $("#buwei").val(), "jianchaxiang": $("#jianchaxiang").val() }, function (json) {
      $("#zhenghou").empty();
      for (var i = 0; i < json.list.length; i++) {
        $("#zhenghou").append("<option value='" + json.list[i].name + "'>" + json.list[i].name + "</option>");
      }
    });
  }
  function addzz() {
    if ($("#zhenghou_qt").val() != "") {
      zhengzhuang.push({ "yianid": _app_guid, "buwei": "-", "jianchaxiang": "-", "zhenghou": $("#zhenghou_qt").val() });
      getZhenzhuang();
      $("#zhenghou_qt").val("");
      return;
    }
    if (!exist($("#buwei").val(), $("#jianchaxiang").val(), $("#zhenghou").val())) {
      zhengzhuang.push({ "yianid": _app_guid, "buwei": $("#buwei").val(), "jianchaxiang": $("#jianchaxiang").val(), "zhenghou": $("#zhenghou").val() });
      getZhenzhuang();
    }
  }

  function exist(buwei, jianchaxiang, zhenghou) {
    for (var i = 0; i < zhengzhuang.length; i++) {
      if (zhengzhuang[i].buwei == buwei && zhengzhuang[i].jianchaxiang == jianchaxiang && zhengzhuang[i].zhenghou == zhenghou) {
        return true;
      }
    }
    return false;
  }

  function delzz(buwei, jianchaxiang, zhenghou) {
    var retList = [];
    for (var i = 0; i < zhengzhuang.length; i++) {
      if (zhengzhuang[i].buwei == buwei && zhengzhuang[i].jianchaxiang == jianchaxiang && zhengzhuang[i].zhenghou == zhenghou) {
        continue;
      }
      retList.push(zhengzhuang[i]);
    }
    zhengzhuang = retList;
    getZhenzhuang();
  }

  function getZhenzhuang() {
    $("#divZhenzhuang").html("");
    if (zhengzhuang) {
      var html = "";
      for (var i = 0; i < zhengzhuang.length; i++) {
        html += '<span class="zhengzhuanspan">' + zhengzhuang[i].buwei + '&nbsp;' + zhengzhuang[i].jianchaxiang + '&nbsp;' + zhengzhuang[i].zhenghou + '<img src="/images/quxiao.png" alt="" class="quxiaopic" onclick="delzz(\'' + zhengzhuang[i].buwei + '\',\'' + zhengzhuang[i].jianchaxiang + '\',\'' + zhengzhuang[i].zhenghou + '\')"> </span>';
      }
      $("#divZhenzhuang").html(html);
    }
  }
  function selectz() {
    util.getJSON("/Xyzz/GetNames", { "name": $("#zhengzhuang").val() }, function (json) {
      var ret = "";
      for (var i = 0; i < json.list.length; i++) {
        ret += "<p><a onclick='selectedzz(\"" + json.list[i].mingcheng + "\")'>" + json.list[i].mingcheng + "</a></p>";
      }
      $("#selectZZ").html(ret);
      $("#selectZZ").show();
    });
  }
  function selectRecord() {
    if ($("#xingming").val() == "" || $("#jiuzhenyisheng").val() == "")
      return;
    util.getJSON("/FirstCheck/GetRecord", { "xm": $("#xingming").val(), "ys": $("#jiuzhenyisheng").val(), "zhongxiyi": zhongxiyi }, function (json) {
      var ret = "";
      for (var i = 0; i < json.list.length; i++) {
        ret += "<tr>";
        ret += '<td width="13%" class="tdname">';
        if (i == 0) {
          ret += "就诊记录";
        }
        ret += "</td>";
        ret += '<td> <a href="/gjiwx/view/' + json.list[i].id + '">' + json.list[i].xingming + ' &nbsp; &nbsp; ' + json.list[i].jiuzhenleixin + ' &nbsp; &nbsp;   ' + util.formateDate(json.list[i].jiuzhenshijian, "yyyy-MM-dd") + '</a> </td>';
        ret += "</tr>";

      }
      $("#divRecord").html(ret);
    });
  }
  function selectedzz(te) {
    $("#zhengzhuang").val(te);
    $("#selectZZ").hide();
  }
  function selectym() {
    util.getJSON("/Zyxx/GetNames", { "name": $("#yaoming_jd").val() }, function (json) {
      var ret = "";
      for (var i = 0; i < json.list.length; i++) {
        ret += "<p><a onclick='selectedym(\"" + json.list[i].yaoming + "\")'>" + json.list[i].yaoming + "</a></p>";
      }
      $("#selectYM").html(ret);
      $("#selectYM").show();
    });
  }
  function selectedym(te) {
    $("#yaoming_jd").val(te);
    $("#selectYM").hide();
  }
  function selectzym() {
    util.getJSON("/Zyxx/GetNames", { "name": $("#zhongyaoming").val() }, function (json) {
      var ret = "";
      for (var i = 0; i < json.list.length; i++) {
        ret += "<p><a onclick='selectedzym(\"" + json.list[i].yaoming + "\")'>" + json.list[i].yaoming + "</a></p>";
      }
      $("#selectZYM").html(ret);
      $("#selectZYM").show();
    });
  }
  function selectedzym(te) {
    $("#zhongyaoming").val(te);
    $("#selectZYM").hide();
  }
  $(document).ready(function () {
    util.getJSON("/FirstCheck/GetBuwei", null, function (json) {
      $("#buwei").empty();
      for (var i = 0; i < json.list.length; i++) {
        $("#buwei").append("<option value='" + json.list[i].name + "'>" + json.list[i].name + "</option>");
      }
      buwei_change();
    });
    if ((usertype == "管理员" || usertype == "审核者") && _app_edit == "edit") {
      $("#btnValidate").show();
    }
    if (_app_edit == "edit") {
      util.getJSON("/FirstCheck/Get", { "id": _app_guid }, function (json) {
        if (json.status == 0) {
          if (json.entity.shenhe && json.entity.shenhe == "提交") {
            $("#lrxx").html('(录入人：' + json.entity.createuser + '， 录入时间：' + util.formateDate(json.entity.createtime, "yyyy-MM-dd hh:mm:ss") + ') ');
            $("#pingfen").html('请对'+json.entity.createuser+'的提交进行打分 ');
          }
          if (json.entity.shenhe && json.entity.shenhe == "一审") {
            $("#lrxx").html('(第一审核人：' + json.entity.firstcheckuser + '， 审核时间：' + util.formateDate(json.entity.firstchecktime, "yyyy-MM-dd hh:mm:ss") + ') ');
            $("#pingfen").html('请对' + json.entity.firstcheckuser + '的首审进行打分 ');
          }

          if (json.entity.shenhe && json.entity.shenhe == "通过") {
            $("#btnValidate").val("已通过审核");
          }

          $("#chufangmingcheng_jb").val(json.entity.chufangmingcheng);
          $("#biaohao").val(json.entity.biaohao);
          $("#xingming").val(json.entity.xingming);
          $("#jiuzhenleixin").val(json.entity.jiuzhenleixin);
          $("#keshi").val(json.entity.keshi);
          $("#jiuzhenyisheng").val(json.entity.jiuzhenyisheng);
          $("#xingbie").val(json.entity.xingbie);
          $("#hunkuang").val(json.entity.hunkuang);
          $("#yaowoguominshi").val(json.entity.yaowoguominshi);
          $("#jiuzhenshijian").val(util.formateDate(json.entity.jiuzhenshijian, "yyyy-MM-dd"));
          $("#year").val(json.entity.year);
          $("#month").val(json.entity.month);
          $("#day").val(json.entity.day);
          $("#otherTime").val(json.entity.otherTime);
          $("#nianling").val(json.entity.nianling);
          $("#fabingjieqi").val(json.entity.fabingjieqi);
          $("#chaodai").val(json.entity.chaodai);
          $("#shuming").val(json.entity.shuming);
          $("#yema").val(json.entity.yema);
          $("#yemaEnd").val(json.entity.yemaEnd);
          $("#banci").val(json.entity.banci);
          $("#chubanshijian").val(json.entity.chubanshijian);
          $("#zuozhe").val(json.entity.zuozhe);
          $("#chubanshe").val(json.entity.chubanshe);
          $("#zhushu").val(json.entity.zhushu);
          $("#xianbingshi").val(json.entity.xianbingshi);
          $("#shezhen").val(json.entity.shezhen);
          $("#shese").val(json.entity.shese);
          $("#taiti").val(json.entity.taiti);
          $("#taizhi").val(json.entity.taizhi);
          $("#sheti").val(json.entity.sheti);
          $("#taise").val(json.entity.taise);
          $("#zhize").val(json.entity.zhize);
          $("#zhifa").val(json.entity.zhifa);
          $("#shuoming").val(json.entity.shuoming);
          $("#chufangmingcheng").val(json.entity.chufangmingcheng);
          $("#leixing").val(json.entity.leixing);
          $("#jixing").val(json.entity.jixing);
          $("#jianfufa").val(json.entity.jianfufa);
          $("#jianfufa_jb").val(json.entity.jianfufa);
          $("#fuyaoshijian").val(json.entity.fuyaoshijian);
          $("#jishu_jb").val(json.entity.jishu);
          $("#jishu").val(json.entity.jishu);
          $("#shiyongfangfa").val(json.entity.shiyongfangfa);
          $("#cishuyaoliang").val(json.entity.cishuyaoliang);
          $("#fuhoufankui").val(json.entity.fuhoufankui);
          $("#qitashixiang").val(json.entity.qitashixiang);
          $("#shenhe").val(json.entity.shenhe);
          $("#img").attr("src", json.entity.shezhentupian);
          $("#img3").attr("src", json.entity.cankaotupian);
          $("#bingji").val(json.entity.bingji);

          $("#jzs").val(json.entity.jzs);
          $("#jws").val(json.entity.jws);
          $("#sysjc").val(json.entity.sysjc);
          $("#qtyz").val(json.entity.qtyz);
          $("#bafx").val(json.entity.bafx);
          $("#xxxd").val(json.entity.xxxd);

          $("#hanre").val(json.entity.hanre);
          $("#hanzhen").val(json.entity.hanzhen);
          $("#xingti").val(json.entity.xingti);
          $("#shenzhi").val(json.entity.shenzhi);
          $("#yinshi").val(json.entity.yinshi);
          $("#yinshui").val(json.entity.yinshui);
          $("#xiaobian").val(json.entity.xiaobian);
          $("#dabian").val(json.entity.dabian);
          $("#shuimian").val(json.entity.shuimian);
          $("#yuyan").val(json.entity.yuyan);
          $("#toumian").val(json.entity.toumian);
          $("#toubu").val(json.entity.toubu);
          $("#ermu").val(json.entity.ermu);
          $("#koubiyan").val(json.entity.koubiyan);
          $("#jingxiang").val(json.entity.jingxiang);
          $("#xiongfu").val(json.entity.xiongfu);
          $("#yaobei").val(json.entity.yaobei);
          $("#sizhi").val(json.entity.sizhi);
          $("#yuejing").val(json.entity.yuejing);
          $("#baidai").val(json.entity.baidai);
          //古籍的新增信息
          $("#zhangjie").val(json.entity.zhangjie);
          $("#twxh").val(json.entity.tiaowenxuhao);
          $("#yuanwen").val(json.entity.yuanwen);

          if (json.entity.jinguzhi == "古制") {
            $("#guzhi").attr("checked", true);
          }
          if (json.entity.jinguzhi == "古制") {
            $("#guzhi_jd").attr("checked", true);
          }
          var i;
          if (json.zhengzhuang) {
            for (i = 0; i < json.zhengzhuang.length; i++) {
              zhengzhuang.push({ "yianid": _app_guid, "zhengzhuang": json.zhengzhuang[i].zhengzhuang });
            }
          }
          zhengzhuang = json.zhengzhuang;
          if (json.jiancha) {
            for (i = 0; i < json.jiancha.length; i++) {
              jiancha.push({ "yianid": _app_guid, "jianchaxiangmu": json.jiancha[i].jianchaxiangmu, "shijian": util.formateDate(json.jiancha[i].shijian,"yyyy-MM-dd"), "jieguo": json.jiancha[i].jieguo, "tupian": json.jiancha[i].tupian });
            }
          }
          jiancha = json.jiancha;
          if (json.chufang) {
            for (i = 0; i < json.chufang.length; i++) {
              chufang.push({ "yianid": _app_guid, "zhongyaoming": json.chufang[i].zhongyaoming, "yaoliang": json.chufang[i].yaoliang, "jinguzhi": json.chufang[i].jinguzhi, "daiding": json.chufang[i].daiding, "paozhi": json.chufang[i].paozhi, "chandi": json.chufang[i].chandi, "beizhu": json.chufang[i].beizhu });
            }
          }
          chufang = json.chufang;
          if (json.maizhen) {
            for (i = 0; i < json.maizhen.length; i++) {
              maizhen.push({ "yianid": _app_guid, "name": json.maizhen[i].name });
            }
          }
          if (json.zhongyi) {
            for (i = 0; i < json.zhongyi.length; i++) {
              zhongyi.push({ "yianid": _app_guid, "name": json.zhongyi[i].name });
            }
          }
          if (json.xiyi) {
            for (i = 0; i < json.xiyi.length; i++) {
              xiyi.push({ "yianid": _app_guid, "name": json.xiyi[i].name });
            }
          }
          if (json.cankao) {
            for (i = 0; i < json.cankao.length; i++) {
              cankao.push({ "yianid": _app_guid, "name": json.cankao[i].name, "image": json.cankao[i].image });
            }
          }
          getZhenzhuang();
          getJiancha();
          getChufang();
          getMaizhen();
          getzy();
          getxy();
          getCK();
        }
      });
      $("#divTitle").html("更新医案信息");

    } else {
      $("#divTitle").html("创建医案信息");
    }
  });

  function getCK() {
    var html = '';
    for (var i = 0; i < cankao.length; i++) {
      html += '<tr><td style="border: 1px solid #ccc;">' + cankao[i].name + '</td>';
      html += '<td style="border: 1px solid #ccc;"><a href="/files/gjiwx/' + cankao[i].image + '" target="_blank">查看</a>&nbsp;&nbsp;<a href="javascript:delCK(\'' + cankao[i].image + '\')">删除</a></tr></td>';
    }
    $("#tblCanKao").html(html);
  }
  function delCK(text) {
    var retList = [];
    for (var i = 0; i < cankao.length; i++) {
      if (cankao[i].image != text) {
        retList.push(cankao[i]);
      }
    }
    cankao = retList;
    getCK();
  }

  //保存
  function saveInfo_new() {
    if ($("#xingming").val() == "") {
      alert("请输入患者姓名");
      $("#xingming").focus();
      return;
    }
    var maizhenzhuangkuang = "";
    $('input:checkbox[name=maizhenzhuangkuang]:checked').each(function () {
      maizhenzhuangkuang += $(this).val() + ",";
    });

    var chufangmingcheng;
    var jishu;
    var jinguzhi;
    var jianfufa;
    if (_jb_xb_flag == 1) {
      chufangmingcheng = $("#chufangmingcheng_jb").val();
      jishu = $("#jishu_jb").val();
      jinguzhi = $("input[name='jinguzhi_jd']:checked").val();
      jianfufa = $("#jianfufa_jb").val();
    }
    else {
      chufangmingcheng = $("#chufangmingcheng").val();
      jishu = $("#jishu").val();
      jinguzhi = $("input[name='jinguzhi']:checked").val();
      jianfufa = $("#jianfufa").val();
    }
    var entity = {
      "biaohao": $("#biaohao").val(),
      "xingming": $("#xingming").val(),
      "jiuzhenyisheng": $("#jiuzhenyisheng").val(),
      "jiuzhenleixin": $("#jiuzhenleixin").val(),
      "keshi": $("#keshi").val(),
      "xingbie": $("#xingbie").val(),
      "hunkuang": $("#hunkuang").val(),
      "yaowoguominshi": $("#yaowoguominshi").val(),
      "jiuzhenshijian": $("#jiuzhenshijian").val(),
      "year": $("#year").val(),
      "month": $("#month").val(),
      "day": $("#day").val(),
      "otherTime": $("#otherTime").val(),
      "nianling": $("#nianling").val(),
      "fabingjieqi": $("#fabingjieqi").val(),
      "chaodai": $("#chaodai").val(),
      "shuming": $("#shuming").val(),
      "yema": $("#yema").val(),
      "yemaEnd": $("#yemaEnd").val(),
      "banci": $("#banci").val(),
      "chubanshijian": $("#chubanshijian").val(),
      "zuozhe": $("#zuozhe").val(),
      "chubanshe": $("#chubanshe").val(),

      "zhushu": $("#zhushu").val(),
      "xianbingshi": $("#xianbingshi").val(),
      "shensexingtai": $("#shensexingtai").val(),
      "mianse": $("#mianse").val(),
      "chunse": $("#chunse").val(),
      "chunzhi": $("#chunzhi").val(),
      "shezhen": $("#shezhen").val(),
      "shezhentupian": $("#hidSmallPic").val(),
      "cankaotupian": $("#hidSmallPic3").val(),
      "shese": $("#shese").val(),
      "taiti": $("#taiti").val(),
      "taizhi": $("#taizhi").val(),
      "sheti": $("#sheti").val(),
      "taise": $("#taise").val(),
      "wenzhen": $("#wenzhen").val(),
      "zhize": $("#zhize").val(),
      "zhifa": $("#zhifa").val(),
      "shuoming": $("#shuoming").val(),
      "chufangmingcheng": chufangmingcheng,
      "leixing": $("#leixing").val(),
      "jixing": $("#jixing").val(),
      "jianfufa": jianfufa,
      "fuyaoshijian": $("#fuyaoshijian").val(),
      "jishu": jishu,
      "shiyongfangfa": $("#shiyongfangfa").val(),
      "cishuyaoliang": $("#cishuyaoliang").val(),
      "fuhoufankui": $("#fuhoufankui").val(),
      "qitashixiang": $("#qitashixiang").val(),
      "bingji": $("#bingji").val(),
      "jinguzhi": $("#qitashixiang").val(),
      "jzs": $("#jzs").val(),
      "jws": $("#jws").val(),
      "sysjc": $("#sysjc").val(),
      "qtyz": $("#qtyz").val(),
      "bafx": $("#bafx").val(),
      "xxxd": $("#xxxd").val(),

      "hanre": $("#hanre").val(),
      "hanzhen": $("#hanzhen").val(),
      "xingti": $("#xingti").val(),
      "shenzhi": $("#shenzhi").val(),
      "yinshi": $("#yinshi").val(),
      "yinshui": $("#yinshui").val(),
      "xiaobian": $("#xiaobian").val(),
      "dabian": $("#dabian").val(),
      "shuimian": $("#shuimian").val(),
      "yuyan": $("#yuyan").val(),
      "toumian": $("#toumian").val(),
      "toubu": $("#toubu").val(),
      "ermu": $("#ermu").val(),
      "koubiyan": $("#koubiyan").val(),
      "jingxiang": $("#jingxiang").val(),
      "xiongfu": $("#xiongfu").val(),
      "yaobei": $("#yaobei").val(),
      "sizhi": $("#sizhi").val(),
      "yuejing": $("#yuejing").val(),
      "baidai": $("#baidai").val(),
      "fenlei": zhongxiyi,
      //古籍的新增信息
      "zhangjie": $("#zhangjie").val(),
      "tiaowenxuhao": $("#twxh").val(),
      "yuanwen":$("#yuanwen").val()
    };
    var url = "/FirstCheck/Create";
    if (_app_edit == "edit") {
      url = "/FirstCheck/Update";
      entity.id = _app_guid;
    }

    util.postJson(url,
            {
              "entity": entity,
              "zhengzhuang": zhengzhuang,
              "chufang": chufang,
              "jiancha": jiancha,
              "maizhen": maizhen,
              "zhongyi": zhongyi,
              "xiyi": xiyi,
              "cankao": cankao
            }, function (json) {
              if (json.status == 0) {
                alert(json.msg);
                location.href = "/FirstCheck/List";
              } else {
                alert(json.msg);
              }
            });
  }
  function saveInfo() {
    if ($("#xingming").val() == "") {
      alert("请输入患者姓名");
      $("#xingming").focus();
      return;
    }
    var maizhenzhuangkuang = "";
    $('input:checkbox[name=maizhenzhuangkuang]:checked').each(function () {
      maizhenzhuangkuang += $(this).val() + ",";
    });
    var chufangmingcheng;
    var jishu;
    var jinguzhi;
    var jianfufa;
    if (_jb_xb_flag == 1){
      chufangmingcheng = $("#chufangmingcheng_jb").val();
      jishu = $("#jishu_jb").val();
      jinguzhi = $("input[name='jinguzhi_jd']:checked").val();
      jianfufa = $("#jianfufa_jb").val();
    }
    else {
      chufangmingcheng = $("#chufangmingcheng").val();
      jishu = $("#jishu").val();
      jinguzhi = $("input[name='jinguzhi']:checked").val();
      jianfufa = $("#jianfufa").val();
    }
    alert(1);
    var entity = {
      "biaohao": $("#biaohao").val(),
      "xingming": $("#xingming").val(),
      "jiuzhenyisheng": $("#jiuzhenyisheng").val(),
      "jiuzhenleixin": $("#jiuzhenleixin").val(),
      "keshi": $("#keshi").val(),
      "xingbie": $("#xingbie").val(),
      "hunkuang": $("#hunkuang").val(),
      "yaowoguominshi": $("#yaowoguominshi").val(),
      "jiuzhenshijian": $("#jiuzhenshijian").val(),
      "year": $("#year").val(),
      "month": $("#month").val(),
      "day": $("#day").val(),
      "otherTime": $("#otherTime").val(),
      "nianling": $("#nianling").val(),
      "fabingjieqi": $("#fabingjieqi").val(),
      "chaodai": $("#chaodai").val(),
      "shuming": $("#shuming").val(),
      "yema": $("#yema").val(),
      "yemaEnd": $("#yemaEnd").val(),
      "banci": $("#banci").val(),
      "chubanshijian": $("#chubanshijian").val(),
      "zuozhe": $("#zuozhe").val(),
      "chubanshe": $("#chubanshe").val(),

      "zhushu": $("#zhushu").val(),
      "xianbingshi": $("#xianbingshi").val(),
      "shensexingtai": $("#shensexingtai").val(),
      "mianse": $("#mianse").val(),
      "chunse": $("#chunse").val(),
      "chunzhi": $("#chunzhi").val(),
      "shezhen": $("#shezhen").val(),
      "shezhentupian": $("#hidSmallPic").val(),
      "cankaotupian": $("#hidSmallPic3").val(),
      "shese": $("#shese").val(),
      "taiti": $("#taiti").val(),
      "taizhi": $("#taizhi").val(),
      "sheti": $("#sheti").val(),
      "taise": $("#taise").val(),
      "wenzhen": $("#wenzhen").val(),
      "zhize": $("#zhize").val(),
      "zhifa": $("#zhifa").val(),
      "shuoming": $("#shuoming").val(),
      "chufangmingcheng": chufangmingcheng,
      "leixing": $("#leixing").val(),
      "jixing": $("#jixing").val(),
      "jianfufa": jianfufa,
      "fuyaoshijian": $("#fuyaoshijian").val(),
      "jishu": jishu,
      "shiyongfangfa": $("#shiyongfangfa").val(),
      "cishuyaoliang": $("#cishuyaoliang").val(),
      "fuhoufankui": $("#fuhoufankui").val(),
      "qitashixiang": $("#qitashixiang").val(),
      "bingji": $("#bingji").val(),
      "jinguzhi": $("#qitashixiang").val(),
      "jzs": $("#jzs").val(),
      "jws": $("#jws").val(),
      "sysjc": $("#sysjc").val(),
      "qtyz": $("#qtyz").val(),
      "bafx": $("#bafx").val(),
      "xxxd": $("#xxxd").val(),

      "hanre": $("#hanre").val(),
      "hanzhen": $("#hanzhen").val(),
      "xingti": $("#xingti").val(),
      "shenzhi": $("#shenzhi").val(),
      "yinshi": $("#yinshi").val(),
      "yinshui": $("#yinshui").val(),
      "xiaobian": $("#xiaobian").val(),
      "dabian": $("#dabian").val(),
      "shuimian": $("#shuimian").val(),
      "yuyan": $("#yuyan").val(),
      "toumian": $("#toumian").val(),
      "toubu": $("#toubu").val(),
      "ermu": $("#ermu").val(),
      "koubiyan": $("#koubiyan").val(),
      "jingxiang": $("#jingxiang").val(),
      "xiongfu": $("#xiongfu").val(),
      "yaobei": $("#yaobei").val(),
      "sizhi": $("#sizhi").val(),
      "yuejing": $("#yuejing").val(),
      "baidai": $("#baidai").val(),
      //"fenlei": zhongxiyi,
      ////古籍的新增信息
      "zhangjie": $("#zhangjie").val(),
      "tiaowenxuhao": $("#twxh").val(),
      "yuanwen":$("#yuanwen").val()
    };
    alert(2);
    var url = "/FirstCheck/Create";
    if (_app_edit == "edit") {
      url = "/FirstCheck/Update";
      entity.id = _app_guid;
    }

    util.postJson(url,
            {
              "entity": entity,
              "zhengzhuang": zhengzhuang,
              "chufang": chufang,
              "jiancha": jiancha,
              "maizhen": maizhen,
              "zhongyi": zhongyi,
              "xiyi": xiyi,
              "cankao": cankao
            }, function(json) {
              if (json.status == 0) {
                alert(json.msg);
                location.href = "/FirstCheck/List";
              } else {
                alert(json.msg);
              }
            });
  }
  $(function () {
    $("#smallfile").change(function () {
      $("#spSmallImage").html("正在上传");
      $("#filePost").ajaxSubmit({
        url: "/Files/UploadYian",
        success: function (data) {
          var json = JSON.parse(data);
          if (json.status == 0) {
            $("#hidSmallPic").val(json.msg);
            $("#img").attr("src", "/files/gjiwx/" + json.msg);
          } else {
            alert(json.msg);
          }
          $("#spSmallImage").html("上传头像");
        }
      });
    });
  });
  $(function () {
    $("#smallfile3").change(function () {
      $("#spSmallImage3").html("正在上传");
      $("#filePost").ajaxSubmit({
        url: "/Files/UploadYian3",
        success: function (data) {
          var json = JSON.parse(data);
          if (json.status == 0) {
            var tmp = json.msg.split(",");
            cankao.push({ "yianid": _app_guid, "name": tmp[0], "image": tmp[1] });
            getCK();
          } else {
            alert(json.msg);
          }
          $("#spSmallImage3").html("上传图片");
        }
      });
    });
  });
  $(function () {
    $("#jianchafile").change(function () {
      $("#spJianchaImage").html("正在上传");
      $("#filePost").ajaxSubmit({
        url: "/Files/UploadJiancha",
        success: function (data) {
          var json = JSON.parse(data);
          if (json.status == 0) {
            $("#hidJianchaPic").val(json.msg);
          } else {
            alert(json.msg);
          }
          $("#spJianchaImage").html("已上传");
        }
      });
    });
  });

  function addmz() {
    if ($("#maizhen").val() == "" && $("#maizhen_qt").val() == "") {
      alert("请输入脉诊");
      return;
    }
    if ($("#maizhen_qt").val() != "" && !existmz($("#maizhen_qt").val())) {
      maizhen.push({ "yianid": _app_guid, "name": $("#maizhen_qt").val() });
      $("#maizhen_qt").val("");

    }
    else if (!existmz($("#maizhen").val())) {
      maizhen.push({ "yianid": _app_guid, "name": $("#maizhen").val() });
    }
    getMaizhen();
  }
  function existmz(val) {
    for (var i = 0; i < maizhen.length; i++) {
      if (maizhen[i].name == val) {
        return true;
      }
    }
    return false;
  }
  function delmz(text) {
    var retList = [];
    for (var i = 0; i < maizhen.length; i++) {
      if (maizhen[i].name != text) {
        retList.push(maizhen[i]);
      }
    }
    maizhen = retList;
    getMaizhen();
  }
  function getMaizhen() {
    $("#divmz").html("");
    if (maizhen) {
      var html = "";
      for (var i = 0; i < maizhen.length; i++) {
        html += '<span class="zhengzhuanspan" style="width:50px;">' + maizhen[i].name + '<img src="/images/quxiao.png" alt="" class="quxiaopic" onclick="delmz(\'' + maizhen[i].name + '\')"> </span>';
      }
      $("#divmz").html(html);
    }
  }

  function addzy() {
    if ($("#zyzd").val() == "") {
      alert("请输入病名");
      return;
    }
    if (!existzy($("#zyzd").val())) {
      zhongyi.push({ "yianid": _app_guid, "name": $("#zyzd").val() });
    }
    getzy();
  }
  function existzy(val) {
    for (var i = 0; i < zhongyi.length; i++) {
      if (zhongyi[i].name == val) {
        return true;
      }
    }
    return false;
  }
  function delzy(text) {
    var retList = [];
    for (var i = 0; i < zhongyi.length; i++) {
      if (zhongyi[i].name != text) {
        retList.push(zhongyi[i]);
      }
    }
    zhongyi = retList;
    getzy();
  }
  function getzy() {
    $("#divzy").html("");
    if (zhongyi) {
      var html = "";
      for (var i = 0; i < zhongyi.length; i++) {
        html += '<span class="zhengzhuanspan">' + zhongyi[i].name + '<img src="/images/quxiao.png" alt="" class="quxiaopic" onclick="delzy(\'' + zhongyi[i].name + '\')"> </span>';
      }
      $("#divzy").html(html);
    }
  }

  function addxy() {
    if ($("#xyzd").val() == "") {
      alert("请输入病名");
      return;
    }
    if (!existxy($("#xyzd").val())) {
      xiyi.push({ "yianid": _app_guid, "name": $("#xyzd").val() });
    }
    getxy();
  }
  function existxy(val) {
    for (var i = 0; i < xiyi.length; i++) {
      if (xiyi[i].name == val) {
        return true;
      }
    }
    return false;
  }
  function delxy(text) {
    var retList = [];
    for (var i = 0; i < xiyi.length; i++) {
      if (xiyi[i].name != text) {
        retList.push(xiyi[i]);
      }
    }
    xiyi = retList;
    getxy();
  }
  function getxy() {
    $("#divxy").html("");
    if (xiyi) {
      var html = "";
      for (var i = 0; i < xiyi.length; i++) {
        html += '<span class="zhengzhuanspan">' + xiyi[i].name + '<img src="/images/quxiao.png" alt="" class="quxiaopic" onclick="delxy(\'' + xiyi[i].name + '\')"></img> </span>';
      }
      $("#divxy").html(html);
    }
  }



  function addcf() {
    var sort = 0;
    if (_jb_xb_flag == 2){
      if ($("#zhongyaoming").val() == "") {
        alert("请输入中药名");
        return;
      }
      if (existcf($("#zhongyaoming").val())) {
        alert("中药名信息已经存在");
        return;
      }
      if (chufang.length > 0) {
        sort = chufang[chufang.length - 1].sort + 1;
      }
      var yaoliang = $("#yaoliang").val();
      if (!isNaN(yaoliang)) {
        yaoliang = yaoliang + "克";
      }
      chufang.push({ "yianid": _app_guid, "zhongyaoming": $("#zhongyaoming").val(), "yaoliang": yaoliang, "paozhi": $("#paozhi").val(), "chandi": $("#chandi").val(), "beizhu": $("#beizhu").val(), "daiding": $("#daiding").val(), "sort": sort });
    }
    else {
      if ($("#yaoming_jd").val() == "") {
        alert("请输入中药名");
        return;
      }
      var exist = false;
      for (var i = 0; i < chufang.length; i++) {
        if (chufang[i].zhongyaoming == $("#yaoming_jd").val()) {
          chufang[i].zhongyaoming = $("#yaoming_jd").val();
          chufang[i].yaoliang = $("#yaoliang_jd").val();
          chufang[i].beizhu = $("#beizhu_jd").val();
          exist = true;
          break;
        }
      }
      if (!exist) {
        if (chufang.length > 0) {
          sort = chufang[chufang.length - 1].sort + 1;
        }
        var yaoliang_jd = $("#yaoliang_jd").val();
        if (!isNaN(yaoliang_jd)) {
          yaoliang_jd = yaoliang_jd + "克";
        }
        chufang.push({ "yianid": _app_guid, "zhongyaoming": $("#yaoming_jd").val(), "yaoliang": yaoliang_jd, "paozhi": $("#paozhi").val(), "chandi": $("#chandi").val(), "beizhu": $("#beizhu_jd").val(), "sort": sort });
      }
    }
    $("#zhongyaoming").val("");
    $("#paozhi").val("");
    $("#chandi").val("");
    $("#beizhu").val("");
    $("#yaoming_jd").val("");
    getChufang();
  }
  function existcf(val) {
    for (var i = 0; i < chufang.length; i++) {
      if (chufang[i].zhongyaoming == val) {
        return true;
      }
    }
    return false;
  }

  function delcf(text) {
    var retList = [];
    var flag = true;
    for (var i = 0; i < chufang.length; i++) {
      if (chufang[i].zhongyaoming == text && flag) {
        flag = false;
        continue;
      }
      retList.push(chufang[i]);

    }
    chufang = retList;
    getChufang();
  }
  function up(sort) {
    for (var i = 0; i < chufang.length; i++) {
      if (chufang[i].sort == sort) {
        var tmpsort = chufang[i].sort;
        chufang[i].sort = chufang[i - 1].sort;
        chufang[i - 1].sort = tmpsort;

        var tmp = chufang[i - 1];
        chufang[i - 1] = chufang[i];
        chufang[i] = tmp;
        break;
      }
    }
    getChufang();
  }
  function down(sort) {
    for (var i = 0; i < chufang.length; i++) {
      if (chufang[i].sort == sort) {
        var tmpsort = chufang[i].sort;
        chufang[i].sort = chufang[i + 1].sort;
        chufang[i + 1].sort = tmpsort;

        var tmp = chufang[i + 1];
        chufang[i + 1] = chufang[i];
        chufang[i] = tmp;
        break;
      }
    }
    getChufang();
  }
  function getChufang() {
    $("#tblChufang").html("");
    if (chufang) {
      var html = "";
      var htmlJd = "";
      for (var i = 0; i < chufang.length; i++) {

        html += '<tr align="center">';
        html += '<td width="20%">' + util.FormateNull(chufang[i].zhongyaoming) + '</td>';
        html += '<td width="15%">' + util.FormateNull(chufang[i].yaoliang) + '</td>';
        html += '<td width="15%">' + util.FormateNull(chufang[i].paozhi) + '</td>';
        html += '<td width="15%">' + util.FormateNull(chufang[i].chandi) + '</td>';
        html += '<td width="15%"> ' + util.FormateNull(chufang[i].beizhu) + ' </td>';
        html += '<td width="15%">';
        if (i != 0) {
          html += '<img src="/images/up.png" class="quxiaopic" onclick="up(\'' + chufang[i].sort + '\')"></img>';
        }
        if (i != chufang.length - 1) {
          html += '<img src="/images/down.png" class="quxiaopic" onclick="down(\'' + chufang[i].sort + '\')"></img>';
        }
        html += '<img src="/images/quxiao.png" onclick="delcf(\'' + chufang[i].zhongyaoming + '\')" alt="" class="quxiaopic"></img><img src="/images/edit.png" class="quxiaopic" onclick="updatexx(\'' + chufang[i].zhongyaoming + '\',\'' + chufang[i].yaoliang + '\',\'' + chufang[i].paozhi + '\',\'' + chufang[i].chandi + '\',\'' + chufang[i].beizhu + '\')"></img>';
        html += '</td>';
        html += ' </tr>';

        htmlJd += '<span class="chufangdivspan">' + util.formateTitle(util.FormateNull(chufang[i].zhongyaoming), 3, false) + ' &nbsp; ' + util.FormateNull(chufang[i].yaoliang) + ' &nbsp; ' + util.FormateNull(chufang[i].beizhu) + '  <img src="/images/quxiao.png" onclick="delcf(\'' + chufang[i].zhongyaoming + '\')" alt="" class="quxiaopic"></img><img src="/images/edit.png" class="quxiaopic" onclick="update(\'' + chufang[i].zhongyaoming + '\',\'' + chufang[i].yaoliang + '\')"></img> ';
        if (i != 0) {
          htmlJd += '<img src="/images/up.png" class="quxiaopic" onclick="up(\'' + chufang[i].sort + '\')"></img>';
        }
        if (i != chufang.length - 1) {
          htmlJd += '<img src="/images/down.png" class="quxiaopic" onclick="down(\'' + chufang[i].sort + '\')"></img>';
        }
        htmlJd += '</span>';
      }
      $("#spnumber").html(chufang.length);
      $("#spnumber_jd").html(chufang.length);
      $("#tblChufang").html(html);
      $("#chufangdivjiandan").html(htmlJd);

    }
  }
  function update(yaowu, yongliang) {
    $("#yaoming_jd").val(yaowu);
    $("#yaoliang_jd").val(util.FormateNull(yongliang));
  }
  function updatexx(yaowu, yaoliang, paozhi, chandi, beizhu) {
    $("#zhongyaoming").val(yaowu);
    $("#yaoliang").val(util.FormateNull(yaoliang));
    $("#paozhi").val(util.FormateNull(paozhi));
    $("#chandi").val(util.FormateNull(chandi));
    $("#beizhu").val(util.FormateNull(beizhu));
  }

  function addjc() {
    if ($("#jianchaxiangmu").val() == "") {
      alert("请选择检查项目");
      return;
    }
    if (exist($("#jianchaxiangmu").val())) {
      alert("检查项目信息已经存在");
      return;
    }
    jiancha.push({ "yianid": _app_guid, "jianchaxiangmu": $("#jianchaxiangmu").val(), "shijian": $("#shijian").val(), "jieguo": $("#jieguo").val(), "tupian": $("#hidJianchaPic").val() });
    $("#jianchaxiangmu").val("");
    $("#shijian").val("");
    $("#jieguo").val("");
    $("#hidJianchaPic").val("");
    $("#spJianchaImage").html("上传文件");

    getJiancha();
  }
  function existjc(val) {
    for (var i = 0; i < jiancha.length; i++) {
      if (jiancha[i].jianchaxiangmu == val) {
        return true;
      }
    }
    return false;
  }



  function deljc(text) {
    var retList = [];
    for (var i = 0; i < jiancha.length; i++) {
      if (jiancha[i].jianchaxiangmu != text) {
        retList.push(jiancha[i]);
      }
    }
    jiancha = retList;
    getJiancha();
  }
  function getJiancha() {
    $("#divJiancha").html('<tr bgcolor="#f2f2f2"><td width="20%">检查项目</td><td width="30%">检查时间</td><td width="25%">结果摘要</td><td width="15%">附件</td><td width="10%"></td></tr>');
    if (jiancha) {
      var html = '<tr bgcolor="#f2f2f2"><td width="20%">检查项目</td><td width="30%">检查时间</td><td width="25%">结果摘要</td><td width="15%">附件</td><td width="10%"></td></tr>';
      for (var i = 0; i < jiancha.length; i++) {
        html += '<tr>';
        html += '<td>' + jiancha[i].jianchaxiangmu + '</td>';
        html += '<td>' + util.formateDate(jiancha[i].shijian,"yyyy-MM-dd") + '</td>';
        html += '<td>' + util.FormateNull(jiancha[i].jieguo) + '</td>';
        if (jiancha[i].tupian) {
          html += '<td><a href="/files/jiancha/' + jiancha[i].tupian + '" target="_blank">查看图片</a></td>';
        } else {
          html += '<td>暂无图片</td>';
        }

        html += '<td><a onclick="deljc(\'' + jiancha[i].jianchaxiangmu + '\')">删除</a></td>';
        html += '</tr>';
      }
      $("#divJiancha").html(html);
    }
  }
  function validate() {
    util.postJson("/FirstCheck/FirstValidate",
            {
              "id": _app_guid,
              "score": score
            }, function (json) {
              if (json.status == 0) {
                alert(json.msg);
                location.href = "/FirstCheck/List";
              } else {
                alert(json.msg);
              }
            });
  }
  //根据时间获得对应的节气
  function getjq(yyyy, mm, dd) {
    yyyy = parseInt(yyyy);
    mm = parseInt(mm);
    dd = parseInt(dd);
    mm = mm - 1;
    var sTermInfo = new Array(0, 21208, 42467, 63836, 85337, 107014, 128867,
            150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 331033,
            353350, 375494, 397447, 419210, 440795, 462224, 483532, 504758);
    var solarTerm = new Array("小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨",
            "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露",
            "霜降", "立冬", "小雪", "大雪", "冬至");
    var solarTerms = "";
    while (solarTerms == "") {
      var tmp1 = new Date((31556925974.7 * (yyyy - 1900) + sTermInfo[mm * 2 + 1] * 60000) + Date.UTC(1900, 0, 6, 2, 5));
      var tmp2 = tmp1.getUTCDate();
      if (tmp2 == dd)
        solarTerms = solarTerm[mm * 2 + 1];
      tmp1 = new Date((31556925974.7 * (yyyy - 1900) + sTermInfo[mm * 2] * 60000) + Date.UTC(1900, 0, 6, 2, 5));
      tmp2 = tmp1.getUTCDate(); if (tmp2 == dd) solarTerms = solarTerm[mm * 2];
      if (dd > 1) {
        dd = dd - 1;
      } else {
        mm = mm - 1;
        if (mm < 0) {
          yyyy = yyyy - 1; mm = 11;
        }
        dd = 31;
      }
    }
    return solarTerms;
  }
  var re = new RegExp(/^\d{1,14}(\.)?(\d{1,4})?$/);
  function change() {
    var year = $("#year").val();
    var month = $("#month").val();
    var day = $("#day").val();
    if (parseInt(month) <= 0 || parseInt(month) > 12) {
      alert("月份超出范围");
      $('#month').val("");
      month = "";
    }
    if (parseInt(day) <= 0 || parseInt(day) > 31) {
      alert("日期超出范围");
      $('#day').val("");
      day = "";
    }
    if (!re.test(year) && year != "") {
      alert("年份只能包含数字");
      $('#year').val("");
      year = "";
    }
    if (!re.test(month) && month != "") {
      alert("月份只能包含数字");
      $('#month').val("");
      month = "";
    }
    if (!re.test(day) && day != "") {
      alert("日期只能包含数字");
      $('#day').val("");
      day = "";
    }
    if (year != "" && month != "" && day != "") {
      var solarTerms = getjq(year, month, day);
      $('#fabingjieqi').val(solarTerms);
    } else {
      $('#fabingjieqi').val("其它");
    }
  }
</script>